diff options
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/llimagebmp.cpp | 6 | ||||
| -rw-r--r-- | indra/llimage/llimagedxt.cpp | 6 | ||||
| -rw-r--r-- | indra/llimage/llimagejpeg.cpp | 6 | 
3 files changed, 18 insertions, 0 deletions
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp index 2a328675c2..c8f99380ea 100644 --- a/indra/llimage/llimagebmp.cpp +++ b/indra/llimage/llimagebmp.cpp @@ -558,6 +558,12 @@ bool LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)          LL_INFOS() << "Dropping alpha information during BMP encoding" << LL_ENDL;      } +    if (raw_image->isBufferInvalid()) +    { +        setLastError("Invalid input, no buffer"); +        return false; +    } +      setSize(raw_image->getWidth(), raw_image->getHeight(), dst_components);      U8 magic[14]; diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 6b960f9077..c3fd0c5aa8 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -329,6 +329,12 @@ bool LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_  {      llassert_always(raw_image); +    if (raw_image->isBufferInvalid()) +    { +        setLastError("Invalid input, no buffer"); +        return false; +    } +      S32 ncomponents = raw_image->getComponents();      EFileFormat format;      switch (ncomponents) diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index dd3efb3459..71b139bc82 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -497,6 +497,12 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )      resetLastError(); +    if (raw_image->isBufferInvalid()) +    { +        setLastError("Invalid input, no buffer"); +        return false; +    } +      LLImageDataSharedLock lockIn(raw_image);      LLImageDataLock lockOut(this);  | 
