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

skip checking png block crcs when fuzzing

Change-Id: If4671f7db2afb46dc68aa7a8a92c509e1735ab9f
Reviewed-on: https://gerrit.libreoffice.org/58051
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst aa415ee2
......@@ -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
......
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