diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-24 20:42:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-25 09:56:28 +0200 |
commit | 5f11e921fb878cc6fd6a15181a416e0143e389f7 (patch) | |
tree | 0ef588441269e45fb439d87c423deafdd0d3d60c /starmath | |
parent | 71c4c0628570b960c9d6ba14222e1b1324447937 (diff) |
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I15d68391e20fba3a8ba46621aac0c831cd0900b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathtype.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index cb46776cc618..acdeba5fcfb6 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -570,7 +570,7 @@ bool MathType::Parse(SvStream* pStream) pS->ReadUChar( nProdVersion ); pS->ReadUChar( nProdSubVersion ); - if (nVersion > 3) // allow only supported versions of MathType to be parsed + if (!pS->good() || nVersion > 3) // allow only supported versions of MathType to be parsed return false; bool bRet = HandleRecords(0); @@ -637,7 +637,7 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, return false; sal_uInt8 nTag,nRecord; - sal_uInt8 nTabType,nTabStops; + sal_uInt8 nTabType; sal_uInt16 nTabOffset; int i, newline=0; bool bSilent=false; @@ -1688,6 +1688,8 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, HandleEmblishments(); break; case RULER: + { + sal_uInt8 nTabStops(0); pS->ReadUChar( nTabStops ); for (i=0;i<nTabStops;i++) { @@ -1696,6 +1698,7 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector, } SAL_WARN("starmath", "Not seen in the wild Equation Ruler Field"); break; + } case FONT: { MathTypeFont aFont; |