Kaydet (Commit) 83113db9 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

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 9e793f60
...@@ -1394,9 +1394,13 @@ void WMFReader::ReadWMF() ...@@ -1394,9 +1394,13 @@ void WMFReader::ReadWMF()
} }
} }
} }
nPos += nRecSize * 2; const sal_uInt32 nAvailableBytes = nEndPos - nPos;
if ( nPos <= nEndPos ) const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
pWMF->Seek( nPos ); if (nRecSize <= nMaxPossibleRecordSize)
{
nPos += nRecSize * 2;
pWMF->Seek(nPos);
}
else else
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); 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