diff options
author | thickbrick | 2011-04-13 17:05:43 +0300 |
---|---|---|
committer | McCabe Maxsted | 2011-04-19 16:48:04 -0700 |
commit | f1d8ce177f64788af199f5ce234392bed73d0a3b (patch) | |
tree | 02114aef55c1beed43a643714d1ad86883dece0d /linden | |
parent | Bug #869 Related: revert 721c25d8 (and d3741625). It wasn't doing anything fo... (diff) | |
download | meta-impy-f1d8ce177f64788af199f5ce234392bed73d0a3b.zip meta-impy-f1d8ce177f64788af199f5ce234392bed73d0a3b.tar.gz meta-impy-f1d8ce177f64788af199f5ce234392bed73d0a3b.tar.bz2 meta-impy-f1d8ce177f64788af199f5ce234392bed73d0a3b.tar.xz |
Fix #869: Fixed failure path for j2c decode, from Siana Gearz
- Sets base.mDecoding to false on failure (from Snowglobe.)
- Handle those failures in the image pipeline (research and patch by
Siana Gearz / Singularity.)
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/llimage/llimageworker.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llimagej2coj/llimagej2coj.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/linden/indra/llimage/llimageworker.cpp b/linden/indra/llimage/llimageworker.cpp index dc989e5..5e61f69 100644 --- a/linden/indra/llimage/llimageworker.cpp +++ b/linden/indra/llimage/llimageworker.cpp | |||
@@ -164,7 +164,7 @@ void LLImageDecodeThread::ImageRequest::finishRequest(bool completed) | |||
164 | { | 164 | { |
165 | if (mResponder.notNull()) | 165 | if (mResponder.notNull()) |
166 | { | 166 | { |
167 | bool success = completed && mDecodedRaw && (!mNeedsAux || mDecodedAux); | 167 | bool success = completed && mDecodedRaw && mDecodedImageRaw->getDataSize() && (!mNeedsAux || mDecodedAux); |
168 | mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux); | 168 | mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux); |
169 | } | 169 | } |
170 | // Will automatically be deleted | 170 | // Will automatically be deleted |
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp index b7a1b82..f003d60 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.cpp +++ b/linden/indra/llimagej2coj/llimagej2coj.cpp | |||
@@ -170,6 +170,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
170 | if(!image) | 170 | if(!image) |
171 | { | 171 | { |
172 | LL_DEBUGS("Openjpeg") << "ERROR -> decodeImpl: failed to decode image - no image" << LL_ENDL; | 172 | LL_DEBUGS("Openjpeg") << "ERROR -> decodeImpl: failed to decode image - no image" << LL_ENDL; |
173 | base.decodeFailed(); | ||
173 | return TRUE; // done | 174 | return TRUE; // done |
174 | } | 175 | } |
175 | 176 | ||
@@ -183,6 +184,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
183 | opj_image_destroy(image); | 184 | opj_image_destroy(image); |
184 | } | 185 | } |
185 | 186 | ||
187 | base.decodeFailed(); | ||
186 | return TRUE; // done | 188 | return TRUE; // done |
187 | } | 189 | } |
188 | 190 | ||
@@ -194,7 +196,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
194 | // if we didn't get the discard level we're expecting, fail | 196 | // if we didn't get the discard level we're expecting, fail |
195 | if (image) //anyway somthing odd with the image, better check than crash | 197 | if (image) //anyway somthing odd with the image, better check than crash |
196 | opj_image_destroy(image); | 198 | opj_image_destroy(image); |
197 | base.mDecoding = FALSE; | 199 | base.decodeFailed(); |
198 | return TRUE; | 200 | return TRUE; |
199 | } | 201 | } |
200 | } | 202 | } |
@@ -207,6 +209,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
207 | opj_image_destroy(image); | 209 | opj_image_destroy(image); |
208 | } | 210 | } |
209 | 211 | ||
212 | base.decodeFailed(); | ||
210 | return TRUE; | 213 | return TRUE; |
211 | } | 214 | } |
212 | 215 | ||
@@ -254,6 +257,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
254 | llwarns << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << llendl; | 257 | llwarns << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << llendl; |
255 | opj_image_destroy(image); | 258 | opj_image_destroy(image); |
256 | 259 | ||
260 | base.decodeFailed(); | ||
257 | return TRUE; // done | 261 | return TRUE; // done |
258 | } | 262 | } |
259 | } | 263 | } |