diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-08-13 14:40:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-08-13 22:16:02 +0200 |
commit | 1845eec0198200bbdac636057d9e3f62e326e3ac (patch) | |
tree | 545c9152309ebdf34c307b0051751ffb13f38bdc /emfio/source | |
parent | 5b3b0a91edc4c468c7c9c132cd066c0d25de9706 (diff) |
ofz#3028: use of uninitialized values
Change-Id: I87bf37e4ae559c8057ac34b7d6dea52cf9468540
Reviewed-on: https://gerrit.libreoffice.org/41114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
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; |