From 6fcf38217e8772b2f90c7a8e7ce6b60071f6d20c Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 25 Mar 2008 22:50:26 +0000 Subject: merge release@82858 maint-render-2-merge@83010 -> release QAR-389 --- indra/llimagej2coj/llimagej2coj.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llimagej2coj') diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index d7be118875..dfc5d4520b 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -158,6 +158,18 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod return TRUE; // done } + // sometimes we get bad data out of the cache - check to see if the decode succeeded + for (S32 i = 0; i < image->numcomps; i++) + { + if (image->comps[i].factor != base.getRawDiscardLevel()) + { + // if we didn't get the discard level we're expecting, fail + opj_image_destroy(image); + base.mDecoding = FALSE; + return TRUE; + } + } + // Copy image data into our raw image format (instead of the separate channel format S32 img_components = image->numcomps; -- cgit v1.2.3