summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorHerbert Dürr <hdu@apache.org>2012-05-09 08:28:41 +0000
committerHerbert Dürr <hdu@apache.org>2012-05-09 08:28:41 +0000
commitfcea3ced92c290ac215bb0392d4d3b507dce245b (patch)
treea814734d8f26ae7dc99f8d56f1b9437860540d3d /vcl/source
parentc466b30aaec0b2d5775013015db14cdaa53cb2db (diff)
ensure PNG header chunks uniqueness
Notes
Notes: prefer: 9ff94ae0fa947c5fd6a31fbc38421f60eb5e1fba
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/pngread.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index c776c9afc11d..89e96799919f 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -197,6 +197,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpScanPrior ( NULL ),
mpTransTab ( NULL ),
mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
+ mnColorType( 0xFF ),
+ mbPalette( false ),
mbzCodecInUse ( sal_False ),
mbStatus( sal_True),
mbIDAT( sal_False ),
@@ -366,6 +368,10 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// reset to the first chunk
maChunkIter = maChunkSeq.begin();
+ // read the first chunk which must be the IHDR chunk
+ ReadNextChunk();
+ mbStatus = (mnChunkType == PNGCHUNK_IHDR) && ImplReadHeader( rPreviewSizeHint );
+
// parse the chunks
while( mbStatus && !mbIDAT && ReadNextChunk() )
{
@@ -373,7 +379,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
{
case PNGCHUNK_IHDR :
{
- mbStatus = ImplReadHeader( rPreviewSizeHint );
+ mbStatus = false; // only one IHDR possible
}
break;