[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 25 12:51:46 UTC 2021


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

New commits:
commit 9ebceed2e50c111655dd64dde6e8306afe1cae84
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 23 20:17:42 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Aug 25 14:51:11 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: I768cec434ee20e6e46eb3993c873bed05b3c9cc3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120925
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit a0e92a64a9a6069ee21336888f3781ffe144b2df)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120974
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx
index 56945e9d9c4b..80fcf7e99df3 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -55,8 +55,8 @@ bool isPng(SvStream& rStream)
 {
     // Check signature bytes
     sal_uInt8 aHeader[PNG_SIGNATURE_SIZE];
-    rStream.ReadBytes(aHeader, PNG_SIGNATURE_SIZE);
-
+    if (rStream.ReadBytes(aHeader, PNG_SIGNATURE_SIZE) != PNG_SIGNATURE_SIZE)
+        return false;
     return png_sig_cmp(aHeader, 0, PNG_SIGNATURE_SIZE) == 0;
 }
 


More information about the Libreoffice-commits mailing list