summaryrefslogtreecommitdiffstats
path: root/emfio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-28 21:48:21 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-30 14:11:13 +0200
commite40da04c6fa28a23aa838b05c976527c5dd3b57e (patch)
tree9238965c6c91a84c6e5b7f2faf5d196a7c3ed703 /emfio
parentofz: MemorySanitizer: use-of-uninitialized-value (diff)
downloadcore-e40da04c6fa28a23aa838b05c976527c5dd3b57e.tar.gz
core-e40da04c6fa28a23aa838b05c976527c5dd3b57e.zip
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;