diff options
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index b27b49e307f7..97861c225306 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -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; |