don't hang with 0 len causing no progression
Change-Id: Ie553dab291c7bfbde033d89b84159aff6b42a160
This commit is contained in:
BIN
filter/qa/cppunit/data/met/fail/hang-1.met
Normal file
BIN
filter/qa/cppunit/data/met/fail/hang-1.met
Normal file
Binary file not shown.
@@ -2239,7 +2239,6 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen)
|
|||||||
void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
|
void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
|
||||||
{
|
{
|
||||||
sal_uLong nPos, nMaxPos;
|
sal_uLong nPos, nMaxPos;
|
||||||
sal_uInt16 nLen;
|
|
||||||
sal_uInt8 nByte, nTripType, nTripType2;
|
sal_uInt8 nByte, nTripType, nTripType2;
|
||||||
OSFont * pF=new OSFont;
|
OSFont * pF=new OSFont;
|
||||||
pF->pSucc=pFontList; pFontList=pF;
|
pF->pSucc=pFontList; pFontList=pF;
|
||||||
@@ -2251,7 +2250,13 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
|
|||||||
nMaxPos=nPos+(sal_uLong)nFieldSize;
|
nMaxPos=nPos+(sal_uLong)nFieldSize;
|
||||||
pOS2MET->SeekRel(2); nPos+=2;
|
pOS2MET->SeekRel(2); nPos+=2;
|
||||||
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
|
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
|
||||||
pOS2MET->ReadUChar( nByte ); nLen =((sal_uInt16)nByte) & 0x00ff;
|
pOS2MET->ReadUChar( nByte );
|
||||||
|
sal_uInt16 nLen = ((sal_uInt16)nByte) & 0x00ff;
|
||||||
|
if (nLen == 0)
|
||||||
|
{
|
||||||
|
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
|
||||||
|
ErrorCode=4;
|
||||||
|
}
|
||||||
pOS2MET->ReadUChar( nTripType );
|
pOS2MET->ReadUChar( nTripType );
|
||||||
switch (nTripType) {
|
switch (nTripType) {
|
||||||
case 0x02:
|
case 0x02:
|
||||||
@@ -2303,7 +2308,8 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nPos+=nLen; pOS2MET->Seek(nPos);
|
nPos+=nLen;
|
||||||
|
pOS2MET->Seek(nPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user