Kaydet (Commit) 55486cf6 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Michael Meeks

avoid endless loop with busted wmf

Change-Id: I104de360f2e861e959ad2dad434a768440877f6f
(cherry picked from commit fd274945)
Reviewed-on: https://gerrit.libreoffice.org/16914Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 80e06ad1
......@@ -1394,9 +1394,13 @@ void WMFReader::ReadWMF()
}
}
}
nPos += nRecSize * 2;
if ( nPos <= nEndPos )
pWMF->Seek( nPos );
const sal_uInt32 nAvailableBytes = nEndPos - nPos;
const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
if (nRecSize <= nMaxPossibleRecordSize)
{
nPos += nRecSize * 2;
pWMF->Seek(nPos);
}
else
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
}
......
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