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

New commits:
commit 84da1f50ca8261129909901c2ff72adb9c67510a
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat May 10 20:54:26 2025 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat May 10 22:59:29 2025 +0200

    ofz: PngImageReader::read null-deref on empty png
    
    since:
    
    commit 70162a33fde729998e4d9c7558f3634352738772
    CommitDate: Tue Apr 22 03:10:03 2025 +0200
    
        vcl: Introduce ImportOutput to return BitmapEx or Animation
    
    Change-Id: Ia4bf6e913fa388725e4d6c246e727aa5d946f46b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185147
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index e35216919bdc..b99232f29f49 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -883,8 +883,9 @@ bool PngImageReader::read(ImportOutput& rImportOutput) { 
return reader(mrStream,
 BitmapEx PngImageReader::read()
 {
     ImportOutput aImportOutput;
-    read(aImportOutput);
-    return *aImportOutput.moBitmap;
+    if (read(aImportOutput))
+        return *aImportOutput.moBitmap;
+    return BitmapEx();
 }
 
 BinaryDataContainer PngImageReader::getMicrosoftGifChunk(SvStream& rStream)

Reply via email to