[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 10 09:33:30 UTC 2021


 vcl/source/filter/png/PngImageReader.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 48196e2e159105216d8fdb02da5b6407895063c6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 9 20:41:07 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 10 11:32:57 2021 +0200

    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 at redhat.com>

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);


More information about the Libreoffice-commits mailing list