diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-31 17:11:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-01 11:17:49 +0200 |
commit | b3e7d61278701ffcc5330e8d65cf9e78991a1754 (patch) | |
tree | a121f3b018d8f90e76a03e5b16e982c544c4acb2 | |
parent | 3413d88ff2aff3d717ffe555ea5998b7a1c37396 (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.cxx | 5 |
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; |