vcl/source/filter/ipsd/ipsd.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6d276cd03089219c3ad099d4683ecc0c85bd0468
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Aug 23 17:33:10 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Aug 23 20:50:47 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: Iea17e1d593f0003de3733722f619b10fbd90a303
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120899
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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;
 

Reply via email to