diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llimagej2coj/llimagej2coj.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp index 3ca271c..01868fd 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.cpp +++ b/linden/indra/llimagej2coj/llimagej2coj.cpp | |||
@@ -158,6 +158,18 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
158 | return TRUE; // done | 158 | return TRUE; // done |
159 | } | 159 | } |
160 | 160 | ||
161 | // sometimes we get bad data out of the cache - check to see if the decode succeeded | ||
162 | for (S32 i = 0; i < image->numcomps; i++) | ||
163 | { | ||
164 | if (image->comps[i].factor != base.getRawDiscardLevel()) | ||
165 | { | ||
166 | // if we didn't get the discard level we're expecting, fail | ||
167 | opj_image_destroy(image); | ||
168 | base.mDecoding = FALSE; | ||
169 | return TRUE; | ||
170 | } | ||
171 | } | ||
172 | |||
161 | // Copy image data into our raw image format (instead of the separate channel format | 173 | // Copy image data into our raw image format (instead of the separate channel format |
162 | 174 | ||
163 | S32 img_components = image->numcomps; | 175 | S32 img_components = image->numcomps; |