diff options
| author | callum_linden <none@none> | 2015-10-20 16:39:00 -0700 |
|---|---|---|
| committer | callum_linden <none@none> | 2015-10-20 16:39:00 -0700 |
| commit | 6599e10d00f3a47e90136f5f6cb4b2d1e02cb2e5 (patch) | |
| tree | d48c683923ee978db4dbb0d66cc0d9f45233a68e /indra/llimage/llimagetga.cpp | |
| parent | c16e726d0e2a8c607ce441eb5bf2419b16b41cab (diff) | |
| parent | 4312629e7c5749b86add9d42e6e550602f34dbf5 (diff) | |
Merge with tip of viewer-release
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) { |
