Kaydet (Commit) fcea3ced authored tarafından Herbert Dürr's avatar Herbert Dürr

ensure PNG header chunks uniqueness

üst c466b30a
...@@ -197,6 +197,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) ...@@ -197,6 +197,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpScanPrior ( NULL ), mpScanPrior ( NULL ),
mpTransTab ( NULL ), mpTransTab ( NULL ),
mpColorTable ( (sal_uInt8*) mpDefaultColorTable ), mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
mnColorType( 0xFF ),
mbPalette( false ),
mbzCodecInUse ( sal_False ), mbzCodecInUse ( sal_False ),
mbStatus( sal_True), mbStatus( sal_True),
mbIDAT( sal_False ), mbIDAT( sal_False ),
...@@ -366,6 +368,10 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) ...@@ -366,6 +368,10 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// reset to the first chunk // reset to the first chunk
maChunkIter = maChunkSeq.begin(); maChunkIter = maChunkSeq.begin();
// read the first chunk which must be the IHDR chunk
ReadNextChunk();
mbStatus = (mnChunkType == PNGCHUNK_IHDR) && ImplReadHeader( rPreviewSizeHint );
// parse the chunks // parse the chunks
while( mbStatus && !mbIDAT && ReadNextChunk() ) while( mbStatus && !mbIDAT && ReadNextChunk() )
{ {
...@@ -373,7 +379,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) ...@@ -373,7 +379,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
{ {
case PNGCHUNK_IHDR : case PNGCHUNK_IHDR :
{ {
mbStatus = ImplReadHeader( rPreviewSizeHint ); mbStatus = false; // only one IHDR possible
} }
break; break;
......
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