valgrind + bff: don't add 0xffff oldcode

Invalid read of size 1
   at 0x9DC6247: GIFLZWDecompressor::AddToTable(unsigned short, unsigned short) (decode.cxx:117)

Change-Id: I9cea8dcd4a5eeaa1e793b9be96f82854b9d088af
This commit is contained in:
Caolán McNamara
2014-08-13 09:12:26 +01:00
parent 60fddc8731
commit ddc178e07d
2 changed files with 7 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -156,10 +156,13 @@ bool GIFLZWDecompressor::ProcessOneCode()
}
else if ( ( nCode > nEOICode ) && ( nCode <= nTableSize ) )
{
if ( nCode == nTableSize )
AddToTable( nOldCode, nOldCode );
else
AddToTable( nOldCode, nCode );
if ( nOldCode != 0xffff )
{
if ( nCode == nTableSize )
AddToTable( nOldCode, nOldCode );
else
AddToTable( nOldCode, nCode );
}
}
else
{