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 )
}
break;
}
nPos += nRSize * 2;
if ( nPos <= nEnd )
pStm->Seek( nPos );
else
{
pStm->SetError( SVSTREAM_FILEFORMAT_ERROR );
bRet = false;
}
const sal_uInt32 nAvailableBytes = nEnd - nPos;
const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
if (nRSize <= nMaxPossibleRecordSize)
{
nPos += nRSize * 2;
pStm->Seek( nPos );
}
else
{
pStm->SetError( SVSTREAM_FILEFORMAT_ERROR );
bRet = false;
}
}
}
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