forked from amazingfate/loongoffice
fail on short read
Change-Id: I7215cf8d8b1e4a4156c87507018de3c2b7ed08d8
This commit is contained in:
BIN
filter/qa/cppunit/data/tiff/fail/hang-8.tiff
Normal file
BIN
filter/qa/cppunit/data/tiff/fail/hang-8.tiff
Normal file
Binary file not shown.
@ -656,7 +656,7 @@ bool TIFFReader::ReadMap()
|
||||
}
|
||||
else if ( nCompression == 32773 )
|
||||
{
|
||||
sal_uLong nStrip,nRecCount,nRowBytesLeft,np,i;
|
||||
sal_uLong nStrip,nRecCount,np,i;
|
||||
sal_uInt8 * pdst;
|
||||
nStrip = 0;
|
||||
if ( nStrip >= nNumStripOffsets )
|
||||
@ -673,7 +673,7 @@ bool TIFFReader::ReadMap()
|
||||
return false;
|
||||
pTIFF->Seek(pStripOffsets[nStrip]);
|
||||
}
|
||||
nRowBytesLeft = nBytesPerRow;
|
||||
sal_uLong nRowBytesLeft = nBytesPerRow;
|
||||
if (np >= SAL_N_ELEMENTS(pMap))
|
||||
return false;
|
||||
pdst=pMap[ np ];
|
||||
@ -687,6 +687,8 @@ bool TIFFReader::ReadMap()
|
||||
if ( nRecCount > nRowBytesLeft )
|
||||
return false;
|
||||
pTIFF->Read(pdst,nRecCount);
|
||||
if (!pTIFF->good())
|
||||
return false;
|
||||
pdst+=nRecCount;
|
||||
nRowBytesLeft-=nRecCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user