diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-10-12 16:24:05 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-10-12 16:24:05 -0400 |
| commit | a16a6034c25c5e78331ef1bd13485df8759456e5 (patch) | |
| tree | c1d1ef6f387daa81039b27a2cdb435a31c25b5d7 /indra/llimage/llimagetga.cpp | |
| parent | 5b58bfb937f7f996c7f1b97f15b1c837aa23a463 (diff) | |
| parent | 4312629e7c5749b86add9d42e6e550602f34dbf5 (diff) | |
merge
Diffstat (limited to 'indra/llimage/llimagetga.cpp')
| -rwxr-xr-x | indra/llimage/llimagetga.cpp | 6 |
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) { |
