summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-28 21:48:21 +0100
committerAndras Timar <andras.timar@collabora.com>2021-09-07 11:17:57 +0200
commit6a834c591b61dd3473f702b4aa14edc57a95fc10 (patch)
treefc4439004935d82b9b1020c1bb72282c510083c1 /emfio
parent6dc24d98f574f525ac74bf93d0bed4d44d8721c6 (diff)
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I4a34981e6597743f9f3a9ad6ca063cb347a68d14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121213 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/emfreader.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 144cab9f0021..772f9c695fa3 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1359,12 +1359,17 @@ namespace emfio
{
sal_uInt32 nStartX, nStartY, nEndX, nEndY;
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadUInt32( nStartX ).ReadUInt32( nStartY ).ReadUInt32( nEndX ).ReadUInt32( nEndY );
- tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
- aPoly.Optimize( PolyOptimizeFlags::EDGES );
- if ( nRecType == EMR_CHORD )
- DrawPolygon( aPoly, mbRecordPath );
+ if (!mpInputStream->good())
+ bStatus = false;
else
- DrawPolyLine( aPoly, nRecType == EMR_ARCTO, mbRecordPath );
+ {
+ tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
+ aPoly.Optimize( PolyOptimizeFlags::EDGES );
+ if ( nRecType == EMR_CHORD )
+ DrawPolygon( aPoly, mbRecordPath );
+ else
+ DrawPolyLine( aPoly, nRecType == EMR_ARCTO, mbRecordPath );
+ }
}
break;