vcl/source/filter/GraphicFormatDetector.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
New commits: commit e7c70b352c477afd9b9adab48c7e46a37b701202 Author: Paris Oplopoios <paris.oplopo...@collabora.com> AuthorDate: Sat Jun 24 03:48:32 2023 +0300 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Jun 27 11:18:42 2023 +0200 tdf#156016 Fix bug where SVG check size would be 0 Change-Id: I1c4adf75bbfbce7cb6b779375714b1c1bc7ec50d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153543 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisop...@gmail.com> (cherry picked from commit 85013c57dd29e32ec0411c159ea72824ebca5aa9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153528 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index a0cdd2416c57..fc43cdd963ab 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -1249,7 +1249,7 @@ bool GraphicFormatDetector::checkSVG() SVG_CHECK_SIZE, nDecompressedSize); nCheckSize = std::min<sal_uInt64>(nDecompressedSize, 256); bool bIsSvg(false); - bool bIsGZip = (nDecompressedSize > 0); + bool bIsGZip = mbWasCompressed; const char* pCheckArrayAsCharArray = reinterpret_cast<char*>(pCheckArray); // check for XML // #119176# SVG files which have no xml header at all have shown up this is optional @@ -1279,11 +1279,11 @@ bool GraphicFormatDetector::checkSVG() if (bIsGZip) { - nCheckSize = std::min<sal_uInt64>(nDecompressedSize, 2048); + nCheckSize = std::min<sal_uInt64>(nDecompressedSize, SVG_CHECK_SIZE); } else { - nCheckSize = std::min<sal_uInt64>(mnStreamLength, 2048); + nCheckSize = std::min<sal_uInt64>(mnStreamLength, SVG_CHECK_SIZE); mrStream.Seek(mnStreamPosition); nCheckSize = mrStream.ReadBytes(sExtendedOrDecompressedFirstBytes, nCheckSize); } @@ -1400,7 +1400,6 @@ sal_uInt8* GraphicFormatDetector::checkAndUncompressBuffer(sal_uInt8* aUncompres mbWasCompressed = true; return aUncompressedBuffer; } - nRetSize = 0; mbWasCompressed = false; return maFirstBytes.data(); }