Kaydet (Commit) 4d57671f authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann

124639: correct consideration of not provided header offset when checking certain read header data

üst b85ed261
...@@ -615,12 +615,15 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon ...@@ -615,12 +615,15 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
{ {
DIBV5Header aHeader; DIBV5Header aHeader;
const sal_uLong nStmPos = rIStm.Tell(); const sal_uLong nStmPos = rIStm.Tell();
bool bRet(false); bool bRet( false );
bool bTopDown(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. // Header size claims to extend into the image data.
// Looks like an error. // Looks like an error.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment