incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1346807 - /incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx
Date Wed, 06 Jun 2012 09:58:20 GMT
Author: hdu
Date: Wed Jun  6 09:58:19 2012
New Revision: 1346807

URL: http://svn.apache.org/viewvc?rev=1346807&view=rev
Log:
#i119786# ensure PNG header chunks uniqueness

Found By: Timo Warns

Modified:
    incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx

Modified: incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx?rev=1346807&r1=1346806&r2=1346807&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx (original)
+++ incubator/ooo/branches/AOO34/main/vcl/source/gdi/pngread.cxx Wed Jun  6 09:58:19 2012
@@ -197,6 +197,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& 
 	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( con
     // 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( con
 		{
 			case PNGCHUNK_IHDR :
 			{
-				mbStatus = ImplReadHeader( rPreviewSizeHint );
+				mbStatus = false; // only one IHDR possible
 			}
 			break;
 



Mime
View raw message