starmath/source/mathtype.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4a65109b7ab3cafddad113900754260af2dbb4ea
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Aug 30 14:48:47 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Aug 31 11:27:14 2021 +0200

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

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index fde2defe51e5..d9306c2402df 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2660,6 +2660,8 @@ bool MathType::HandleMatrix(int nLevel, sal_uInt8 
nSelector, sal_uInt8 nVariatio
     pS->ReadUChar( nV_just );
     pS->ReadUChar( nRows );
     pS->ReadUChar( nCols );
+    if (!pS->good())
+        return false;
     int nBytes = ((nRows+1)*2)/8;
     if (((nRows+1)*2)%8)
         nBytes++;

Reply via email to