[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jul 26 12:06:15 UTC 2018
vcl/source/gdi/pngread.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 62955bb8145c95991f7771eb7efb0dc46f744ef5
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 26 09:58:47 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 26 14:05:50 2018 +0200
skip checking png block crcs when fuzzing
Change-Id: If4671f7db2afb46dc68aa7a8a92c509e1735ab9f
Reviewed-on: https://gerrit.libreoffice.org/58051
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index f00a096f5573..f4195fd5c352 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -21,6 +21,7 @@
#include <cassert>
#include <memory>
+#include <unotools/configmgr.hxx>
#include <vcl/pngread.hxx>
#include <cmath>
@@ -134,6 +135,7 @@ private:
bool mbIDATComplete : 1; // true if finished with enough IDAT chunks
bool mbpHYs : 1; // true if physical size of pixel available
bool mbIgnoreGammaChunk : 1;
+ bool mbIgnoreCRC : 1; // skip checking CRCs while fuzzing
#if OSL_DEBUG_LEVEL > 0
// do some checks in debug mode
@@ -214,6 +216,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mbIDATComplete( false ),
mbpHYs ( false ),
mbIgnoreGammaChunk ( false ),
+ mbIgnoreCRC( utl::ConfigManager::IsFuzzing() ),
#if OSL_DEBUG_LEVEL > 0
mnAllocSizeScanline(0),
mnAllocSizeScanlineAlpha(0),
@@ -306,7 +309,7 @@ bool PNGReaderImpl::ReadNextChunk()
}
sal_uInt32 nCheck(0);
mrPNGStream.ReadUInt32( nCheck );
- if( nCRC32 != nCheck )
+ if (!mbIgnoreCRC && nCRC32 != nCheck)
return false;
}
else
More information about the Libreoffice-commits
mailing list