summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/wmfreader.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index 4d5161ed46b9..83e7ca6e81d7 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -805,9 +805,9 @@ namespace emfio
mpInputStream->ReadUInt16( nFunction ).ReadUInt16( nFunction );
ReadDIB(aBmp, *mpInputStream, false);
- Bitmap::ScopedReadAccess pBmp(aBmp);
- if ( pBmp )
+ if ( !!aBmp )
{
+ Bitmap::ScopedReadAccess pBmp(aBmp);
for ( long y = 0; y < pBmp->Height(); y++ )
{
for ( long x = 0; x < pBmp->Width(); x++ )
@@ -822,7 +822,6 @@ namespace emfio
nCount = pBmp->Height() * pBmp->Width();
if ( !nCount )
nCount++;
- pBmp.reset();
}
Color aColor( static_cast<sal_uInt8>( nRed / nCount ), static_cast<sal_uInt8>( nGreen / nCount ), static_cast<sal_uInt8>( nBlue / nCount ) );
CreateObject(o3tl::make_unique<WinMtfFillStyle>( aColor, false ));