diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-07-27 05:49:07 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-07-27 05:49:07 +0300 |
commit | 2339e759fc2d6f36a4b9425022a22a747ec55dad (patch) | |
tree | cdd6316c4a2844fe1d827a146774e7fd9c27aad5 /indra/llkdu | |
parent | 03bff896bd18b71c9a2d8e0b163647b1cd64b871 (diff) |
MAINT-4327/MAINT-6584 Supress the crash on memory allocation error when decoding J2C images
Diffstat (limited to 'indra/llkdu')
-rw-r--r-- | indra/llkdu/llimagej2ckdu.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 0d37b123ec..0863240686 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -422,6 +422,13 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco // Now we are ready to walk through the tiles processing them one-by-one. kdu_byte *buffer = raw_image.getData(); + if (!buffer) + { + base.setLastError("Memory error"); + base.decodeFailed(); + cleanupCodeStream(); + return true; // done + } while (mTPosp->y < mTileIndicesp->size.y) { |