diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-03-25 22:50:26 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-03-25 22:50:26 +0000 |
commit | 6fcf38217e8772b2f90c7a8e7ce6b60071f6d20c (patch) | |
tree | a8e35fe195cc86c616daf9d8a21571e04bc2bc35 /indra/llimagej2coj | |
parent | 11a3589665aae1a2423e258e40eba45c117627d5 (diff) |
merge release@82858 maint-render-2-merge@83010 -> release
QAR-389
Diffstat (limited to 'indra/llimagej2coj')
-rw-r--r-- | indra/llimagej2coj/llimagej2coj.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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; |