vcl/source/filter/ipsd/ipsd.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit 26adaed995097a160063b54a9d2a8d81b34f145d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Aug 23 17:33:10 2021 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Aug 24 12:13:26 2021 +0200 ofz: MemorySanitizer: use-of-uninitialized-value Change-Id: Iea17e1d593f0003de3733722f619b10fbd90a303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120876 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/vcl/source/filter/ipsd/ipsd.cxx b/vcl/source/filter/ipsd/ipsd.cxx index 08e520884754..623a2b14a84e 100644 --- a/vcl/source/filter/ipsd/ipsd.cxx +++ b/vcl/source/filter/ipsd/ipsd.cxx @@ -165,6 +165,9 @@ bool PSDReader::ImplReadHeader() m_rPSD.ReadUInt32( mpFileHeader->nSignature ).ReadUInt16( mpFileHeader->nVersion ).ReadUInt32( mpFileHeader->nPad1 ). ReadUInt16( mpFileHeader->nPad2 ).ReadUInt16( mpFileHeader->nChannels ).ReadUInt32( mpFileHeader->nRows ). ReadUInt32( mpFileHeader->nColumns ).ReadUInt16( mpFileHeader->nDepth ).ReadUInt16( mpFileHeader->nMode ); + if (!m_rPSD.good()) + return false; + if ( ( mpFileHeader->nSignature != 0x38425053 ) || ( mpFileHeader->nVersion != 1 ) ) return false;