vcl/source/gdi/hatch.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit c53570e524cff058d893ea950ce1e538ba925b5e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Mar 5 10:15:45 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Mar 5 14:51:02 2022 +0100

    ofz: Use-of-uninitialized-value
    
    Change-Id: I695b5721ec848845adff0a5c37b931b4cee5370d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131050
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx
index cfb273367742..c7665f610a92 100644
--- a/vcl/source/gdi/hatch.cxx
+++ b/vcl/source/gdi/hatch.cxx
@@ -79,18 +79,21 @@ void Hatch::SetAngle( Degree10 nAngle10 )
 SvStream& ReadHatch( SvStream& rIStm, Hatch& rHatch )
 {
     VersionCompatRead aCompat(rIStm);
-    sal_uInt16 nTmp16;
-    sal_Int32 nTmp32(0);
 
-    rIStm.ReadUInt16(nTmp16);
-    rHatch.mpImplHatch->meStyle = static_cast<HatchStyle>(nTmp16);
+    sal_uInt16 nTmpStyle(0);
+    rIStm.ReadUInt16(nTmpStyle);
+    rHatch.mpImplHatch->meStyle = static_cast<HatchStyle>(nTmpStyle);
 
     tools::GenericTypeSerializer aSerializer(rIStm);
     aSerializer.readColor(rHatch.mpImplHatch->maColor);
+
+    sal_Int32 nTmp32(0);
     rIStm.ReadInt32(nTmp32);
     rHatch.mpImplHatch->mnDistance = nTmp32;
-    rIStm.ReadUInt16(nTmp16);
-    rHatch.mpImplHatch->mnAngle = Degree10(nTmp16);
+
+    sal_uInt16 nTmpAngle(0);
+    rIStm.ReadUInt16(nTmpAngle);
+    rHatch.mpImplHatch->mnAngle = Degree10(nTmpAngle);
 
     return rIStm;
 }

Reply via email to