summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rwxr-xr-xvcl/source/gdi/dibtools.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index d4ea127f5c06..503ccf902d5c 100755
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -615,12 +615,15 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
{
DIBV5Header aHeader;
const sal_uLong nStmPos = rIStm.Tell();
- bool bRet(false);
- bool bTopDown(false);
+ bool bRet( false );
+ bool bTopDown( false );
- if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount)
+ if ( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown )
+ && aHeader.nWidth != 0
+ && aHeader.nHeight != 0
+ && aHeader.nBitCount != 0 )
{
- if (aHeader.nSize > nOffset)
+ if ( nOffset > 0 && aHeader.nSize > nOffset )
{
// Header size claims to extend into the image data.
// Looks like an error.