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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 24 07:36:12 UTC 2021


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

New commits:
commit a0e92a64a9a6069ee21336888f3781ffe144b2df
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 23 20:17:42 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 24 09:35:37 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>

diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx
index c4e04ad0f1d8..e3b3703c1cab 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