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

ofz: further limit exttextout to record size is smaller than stream size

Change-Id: I5f59db9e0c32f601537860d7574044b713d1c39d
Reviewed-on: https://gerrit.libreoffice.org/44696Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 15fb7175
......@@ -553,7 +553,8 @@ namespace emfio
aRect = tools::Rectangle( aPt1, aPt2 );
}
auto nRemainingSize = mpInputStream->remainingSize();
auto nMaxStreamPos = nRecordPos + (nRecordSize << 1);
auto nRemainingSize = std::min(mpInputStream->remainingSize(), nMaxStreamPos - mpInputStream->Tell());
if (nRemainingSize < static_cast<sal_uInt32>(nOriginalBlockLen))
{
SAL_WARN("vcl.wmf", "exttextout record claimed more data than the stream can provide");
......@@ -568,7 +569,6 @@ namespace emfio
if ( nNewTextLen )
{
std::unique_ptr<long[]> pDXAry, pDYAry;
auto nMaxStreamPos = nRecordPos + ( nRecordSize << 1 );
auto nDxArySize = nMaxStreamPos - mpInputStream->Tell();
auto nDxAryEntries = nDxArySize >> 1;
bool bUseDXAry = false;
......
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