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

ofc avoid oom

Change-Id: I2983d97895206db481b990ccd4f0ecd9d8b31b81
üst 7cc8555e
...@@ -946,7 +946,15 @@ bool PlfMcd::Read(SvStream &rS) ...@@ -946,7 +946,15 @@ bool PlfMcd::Read(SvStream &rS)
nOffSet = rS.Tell(); nOffSet = rS.Tell();
Tcg255SubStruct::Read( rS ); Tcg255SubStruct::Read( rS );
rS.ReadInt32( iMac ); rS.ReadInt32( iMac );
if ( iMac ) if (iMac < 0)
return false;
auto nMaxPossibleRecords = rS.remainingSize() / 24 /*sizeof MCD*/;
if (static_cast<sal_uInt32>(iMac) > nMaxPossibleRecords)
{
SAL_WARN("sw.ww8", iMac << " records claimed, but max possible is " << nMaxPossibleRecords);
iMac = nMaxPossibleRecords;
}
if (iMac)
{ {
rgmcd.resize(iMac); rgmcd.resize(iMac);
for ( sal_Int32 index = 0; index < iMac; ++index ) for ( sal_Int32 index = 0; index < iMac; ++index )
......
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