llimage merge

This commit is contained in:
Shyotl
2016-04-06 01:39:56 -05:00
parent 0841479ccc
commit 6ced17242b
5 changed files with 27 additions and 14 deletions

View File

@@ -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() - (S32)mDataOffset)
{ //here we have situation when data size in src less than actually needed
return FALSE;
}
if (getComponents() == 4)
{