fail on short read

Change-Id: I7215cf8d8b1e4a4156c87507018de3c2b7ed08d8
This commit is contained in:
Caolán McNamara
2015-07-20 11:40:34 +01:00
parent 68fed3540a
commit 8eaef6b521
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -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;
}