summaryrefslogtreecommitdiffstats
path: root/emfio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-28 21:48:21 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-08-30 11:51:53 +0200
commit73e00139740d1005d7c08660ca2e3695a300d5c6 (patch)
tree909650d6405fe07eadf579ad39cae55944a7f0ec /emfio
parentofz: MemorySanitizer: use-of-uninitialized-value (diff)
downloadcore-73e00139740d1005d7c08660ca2e3695a300d5c6.tar.gz
core-73e00139740d1005d7c08660ca2e3695a300d5c6.zip
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I4a34981e6597743f9f3a9ad6ca063cb347a68d14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121160 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 4ad77dd3fb32..a1ac109435ad 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1380,12 +1380,17 @@ namespace emfio
{
sal_Int32 nStartX, nStartY, nEndX, nEndY;
mpInputStream->ReadInt32( nX32 ).ReadInt32( nY32 ).ReadInt32( nx32 ).ReadInt32( ny32 ).ReadInt32( nStartX ).ReadInt32( nStartY ).ReadInt32( nEndX ).ReadInt32( nEndY );
- SAL_INFO( "emfio", "\t\t Bounds: " << nX32 << ":" << nY32 << ", " << nx32 << ":" << ny32 << ", Start: " << nStartX << ":" << nStartY << ", End: " << nEndX << ":" << nEndY );
- tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
- if ( nRecType == EMR_CHORD )
- DrawPolygon( aPoly, mbRecordPath );
+ if (!mpInputStream->good())
+ bStatus = false;
else
- DrawPolyLine( aPoly, nRecType == EMR_ARCTO, mbRecordPath );
+ {
+ SAL_INFO( "emfio", "\t\t Bounds: " << nX32 << ":" << nY32 << ", " << nx32 << ":" << ny32 << ", Start: " << nStartX << ":" << nStartY << ", End: " << nEndX << ":" << nEndY );
+ tools::Polygon aPoly( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), PolyStyle::Arc );
+ if ( nRecType == EMR_CHORD )
+ DrawPolygon( aPoly, mbRecordPath );
+ else
+ DrawPolyLine( aPoly, nRecType == EMR_ARCTO, mbRecordPath );
+ }
}
break;