diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-09 20:41:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-07-10 11:32:57 +0200 |
commit | 48196e2e159105216d8fdb02da5b6407895063c6 (patch) | |
tree | 5d979c7b5cda3cae1673c0210f901efb64efa029 | |
parent | 4a93efcf6e7982146fb71e4d32760a07a0f984c2 (diff) |
ofz#32582 use simple output bitmap for fuzzing png
Change-Id: Ie6f03d579f3dfc92ff1d2b6242fe941f74324b41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118701
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/filter/png/PngImageReader.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index 6631c238629e..013254192d3d 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -98,7 +98,8 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, AlphaScopedWriteAccess pWriteAccessAlphaInstance; std::vector<std::vector<png_byte>> aRows; auto pBackendCapabilities = ImplGetSVData()->mpDefInst->GetBackendCapabilities(); - const bool bSupportsBitmap32 = pBackendCapabilities->mbSupportsBitmap32; + const bool bFuzzing = utl::ConfigManager::IsFuzzing(); + const bool bSupportsBitmap32 = pBackendCapabilities->mbSupportsBitmap32 || bFuzzing; const bool bOnlyCreateBitmap = static_cast<bool>(nImportFlags & GraphicFilterImportFlags::OnlyCreateBitmap); const bool bUseExistingBitmap @@ -129,7 +130,7 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, png_set_read_fn(pPng, &rStream, lclReadStream); - if (!utl::ConfigManager::IsFuzzing()) + if (!bFuzzing) png_set_crc_action(pPng, PNG_CRC_ERROR_QUIT, PNG_CRC_WARN_DISCARD); else png_set_crc_action(pPng, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE); |