diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 10a4559a8db4..7a0cb0f6412c 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1442,7 +1442,9 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size ErrCode nStatus = ImpTestOrFindFormat("", rIStream, nFormat); rIStream.Seek(nStreamBegin); - const sal_uInt32 nStreamLength( sizeLimit ? sizeLimit : rIStream.remainingSize()); + sal_uInt32 nStreamLength(rIStream.remainingSize()); + if (sizeLimit && sizeLimit < nStreamLength) + nStreamLength = sizeLimit; OUString aFilterName = pConfig->GetImportFilterName(nFormat); OUString aExternalFilterName = pConfig->GetExternalFilterName(nFormat, false); |