summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagetga.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-10-13 09:49:57 -0400
committerOz Linden <oz@lindenlab.com>2015-10-13 09:49:57 -0400
commit90c26759ef5fe1f35bcda82f444e647d07c28fc6 (patch)
tree5f0d669d275be58fa7543cb1a826b3036c031c13 /indra/llimage/llimagetga.cpp
parent4d81570d62bc9d746565083ef18fdc16c198a5dc (diff)
parent4312629e7c5749b86add9d42e6e550602f34dbf5 (diff)
merge changes for 3.8.5-release
Diffstat (limited to 'indra/llimage/llimagetga.cpp')
-rwxr-xr-xindra/llimage/llimagetga.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 4eb8dc7440..d0ae105ba7 100755
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -437,7 +437,13 @@ BOOL LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, BOOL &alpha_opaqu
// Origin is the bottom left
U8* dst = raw_image->getData();
U8* src = getData() + mDataOffset;
+
S32 pixels = getWidth() * getHeight();
+
+ if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - mDataOffset)
+ { //here we have situation when data size in src less than actually needed
+ return FALSE;
+ }
if (getComponents() == 4)
{