Kaydet (Commit) 7eef63bb authored tarafından Caolán McNamara's avatar Caolán McNamara

fix potential hang here

Change-Id: Id62cdb90420b9ccf4e98fc1af46c70db6ed60ee0
üst ac46405c
...@@ -1735,14 +1735,19 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm ) ...@@ -1735,14 +1735,19 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
} }
break; break;
} }
nPos += nRSize * 2;
if ( nPos <= nEnd ) const sal_uInt32 nAvailableBytes = nEnd - nPos;
pStm->Seek( nPos ); const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
else if (nRSize <= nMaxPossibleRecordSize)
{ {
pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); nPos += nRSize * 2;
bRet = false; pStm->Seek( nPos );
} }
else
{
pStm->SetError( SVSTREAM_FILEFORMAT_ERROR );
bRet = false;
}
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment