[Libreoffice-commits] core.git: emfio/source
Caolán McNamara
caolanm at redhat.com
Sun Aug 13 20:17:16 UTC 2017
emfio/source/reader/emfreader.cxx | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 1845eec0198200bbdac636057d9e3f62e326e3ac
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 13 14:40:33 2017 +0100
ofz#3028: use of uninitialized values
Change-Id: I87bf37e4ae559c8057ac34b7d6dea52cf9468540
Reviewed-on: https://gerrit.libreoffice.org/41114
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index dc8ffdee523f..54b4a4c04e57 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1438,17 +1438,17 @@ namespace emfio
.ReadInt32( cxDest )
.ReadInt32( cyDest );
- Bitmap aBitmap;
- tools::Rectangle aRect( Point( xDest, yDest ), Size( cxDest, cyDest ) );
-
- if ( ((SAL_MAX_UINT32 - 14) < cbBitsSrc)
- || ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc )
- )
+ if (!mpInputStream->good() ||
+ ((SAL_MAX_UINT32 - 14) < cbBitsSrc) ||
+ ((SAL_MAX_UINT32 - 14) - cbBitsSrc < cbBmiSrc))
{
bStatus = false;
}
else
{
+ Bitmap aBitmap;
+ tools::Rectangle aRect( Point( xDest, yDest ), Size( cxDest, cyDest ) );
+
sal_uInt32 nSize = cbBmiSrc + cbBitsSrc + 14;
if ( nSize <= ( mnEndPos - mnStartPos ) )
{
@@ -1525,8 +1525,8 @@ namespace emfio
// const basegfx::B2DVector aTransVec(aWT * basegfx::B2DVector(aLogFont.lfWidth, aLogFont.lfHeight));
// aLogFont.lfWidth = aTransVec.getX();
// aLogFont.lfHeight = aTransVec.getY();
-
- CreateObjectIndexed(nIndex, o3tl::make_unique<WinMtfFontStyle>( aLogFont ));
+ if (mpInputStream->good())
+ CreateObjectIndexed(nIndex, o3tl::make_unique<WinMtfFontStyle>( aLogFont ));
}
}
break;
More information about the Libreoffice-commits
mailing list