summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-31 17:11:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-01 11:17:49 +0200
commitb3e7d61278701ffcc5330e8d65cf9e78991a1754 (patch)
treea121f3b018d8f90e76a03e5b16e982c544c4acb2
parent3413d88ff2aff3d717ffe555ea5998b7a1c37396 (diff)
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: Iebbc5c690231966960a5dd00908a0a4e1bf15bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121400 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/filter/GraphicFormatDetector.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx
index fc4db66f2031..df7cc1fb03d4 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -769,9 +769,8 @@ bool GraphicFormatDetector::checkTGA()
mrStream.Seek(STREAM_SEEK_TO_END);
mrStream.SeekRel(-18);
- mrStream.ReadBytes(sFooterBytes, 18);
-
- if (memcmp(sFooterBytes, "TRUEVISION-XFILE.", SAL_N_ELEMENTS(sFooterBytes)) == 0)
+ if (mrStream.ReadBytes(sFooterBytes, 18) == 18
+ && memcmp(sFooterBytes, "TRUEVISION-XFILE.", SAL_N_ELEMENTS(sFooterBytes)) == 0)
{
msDetectedFormat = "TGA";
return true;