From 4949b38aacdcd5d334352d3e511cd1c2fc20def1 Mon Sep 17 00:00:00 2001 From: siana Date: Tue, 28 Dec 2010 05:15:09 +0100 Subject: [PATCH] Openjpeg crash fix --- indra/libopenjpeg/tcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/libopenjpeg/tcd.c b/indra/libopenjpeg/tcd.c index 7f154f4b0..8f2f24329 100644 --- a/indra/libopenjpeg/tcd.c +++ b/indra/libopenjpeg/tcd.c @@ -1377,7 +1377,10 @@ bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, op opj_tcd_tilecomp_t* tilec = &tile->comps[compno]; /* The +3 is headroom required by the vectorized DWT */ tilec->data = (int*) opj_aligned_malloc((((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0))+3) * sizeof(int)); - t1_decode_cblks(t1, tilec, &tcd->tcp->tccps[compno]); + if(tilec->data) + t1_decode_cblks(t1, tilec, &tcd->tcp->tccps[compno]); + else + opj_event_msg(tcd->cinfo, EVT_ERROR, "tcd_decode: tile size invalid\n"); } t1_destroy(t1); t1_time = opj_clock() - t1_time;