summaryrefslogtreecommitdiff
path: root/emfio/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-15 08:58:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-02-15 12:28:27 +0000
commit199a34194d354f8d05d5a1cea680d63cb3303996 (patch)
tree896da3f473559d61010b6baa7dd8c2643f8b6a09 /emfio/source
parent5c18849cc682a88c4d341fe4c12a69332140a367 (diff)
ofz: Use-of-uninitialized-value
since: commit bbdbe8ea2ef176ef6f08b30b3c18876c2c4f0c22 Date: Fri Feb 3 22:55:54 2023 +0100 tdf#142018 Properly create Pen width if style is COSMETIC Change-Id: I739932e7bbf427a72bf16a771c20b6bd5596da5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio/source')
-rw-r--r--emfio/source/reader/emfreader.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index be4c8319238b..af676e7de669 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1178,19 +1178,21 @@ namespace emfio
sal_Int32 elpHatch;
mpInputStream->ReadUInt32(offBmi).ReadUInt32(cbBmi).ReadUInt32(offBits).ReadUInt32(cbBits);
mpInputStream->ReadUInt32(nPenStyle).ReadUInt32(nWidth).ReadUInt32(nBrushStyle);
- SAL_INFO("emfio", "\t\tStyle: 0x" << std::hex << nPenStyle << std::dec);
- if ((nPenStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
- nPenStyle = PS_COSMETIC;
- if ((nPenStyle & PS_GEOMETRIC) == 0)
- nWidth = 0;
- SAL_INFO("emfio", "\t\tWidth: " << nWidth);
Color aColorRef = ReadColor();
mpInputStream->ReadInt32(elpHatch).ReadUInt32(elpNumEntries);
if (!mpInputStream->good())
bStatus = false;
else
+ {
+ SAL_INFO("emfio", "\t\tStyle: 0x" << std::hex << nPenStyle << std::dec);
+ if ((nPenStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
+ nPenStyle = PS_COSMETIC;
+ if ((nPenStyle & PS_GEOMETRIC) == 0)
+ nWidth = 0;
+ SAL_INFO("emfio", "\t\tWidth: " << nWidth);
CreateObjectIndexed(nIndex, std::make_unique<WinMtfLineStyle>(aColorRef, nPenStyle, nWidth));
+ }
}
}
break;