summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-23 20:17:42 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-08-25 14:51:11 +0200
commit9ebceed2e50c111655dd64dde6e8306afe1cae84 (patch)
treea47cc305c5a3c4c12461511448bbf2072ef34d38
parenttdf#135164 add unit test (diff)
downloadcore-9ebceed2e50c111655dd64dde6e8306afe1cae84.tar.gz
core-9ebceed2e50c111655dd64dde6e8306afe1cae84.zip
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@redhat.com> (cherry picked from commit a0e92a64a9a6069ee21336888f3781ffe144b2df) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120974 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--vcl/source/filter/png/PngImageReader.cxx4
1 files changed, 2 insertions, 2 deletions
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;
}