Author: orw
Date: Thu Apr 10 08:47:58 2014
New Revision: 1586242

URL: http://svn.apache.org/r1586242
Log:
124639: correct consideration of not provided header offset when checking 
certain read header data


Modified:
    openoffice/trunk/main/vcl/source/gdi/dibtools.cxx

Modified: openoffice/trunk/main/vcl/source/gdi/dibtools.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/dibtools.cxx?rev=1586242&r1=1586241&r2=1586242&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/dibtools.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/dibtools.cxx Thu Apr 10 08:47:58 2014
@@ -613,14 +613,17 @@ bool ImplReadDIBBits(SvStream& rIStm, DI
 
 bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, 
sal_uLong nOffset )
 {
-       DIBV5Header aHeader;
-       const sal_uLong nStmPos = rIStm.Tell();
-       bool bRet(false);
-       bool bTopDown(false);
-
-       if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown) && aHeader.nWidth && 
aHeader.nHeight && aHeader.nBitCount)
-       {
-        if (aHeader.nSize > nOffset)
+    DIBV5Header aHeader;
+    const sal_uLong nStmPos = rIStm.Tell();
+    bool bRet( false );
+    bool bTopDown( false );
+
+    if ( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown )
+         && aHeader.nWidth != 0
+         && aHeader.nHeight != 0
+         && aHeader.nBitCount != 0 )
+    {
+        if ( nOffset > 0 && aHeader.nSize > nOffset )
         {
             // Header size claims to extend into the image data.
             // Looks like an error.


Reply via email to