--- vcl/source/gdi/pngread.cxx	2007-04-10 11:53:26.000000000 +0200
+++ vcl/source/gdi/pngread.cxx	2007-04-10 13:03:53.000000000 +0200
@@ -300,9 +300,14 @@ bool PNGReaderImpl::ReadNextChunk()
         if( mnChunkLen && !mrPNGStream.IsEof() )
         {
             rChunkData.aData.resize( mnChunkLen );
-            sal_uInt8* pPtr = &rChunkData.aData[ 0 ];
-            mrPNGStream.Read( pPtr, mnChunkLen );
-            nCRC32 = rtl_crc32( nCRC32, pPtr, mnChunkLen );
+
+            sal_Size nBytesRead = 0;
+            do {
+                sal_uInt8* pPtr = &rChunkData.aData[ nBytesRead ];
+                nBytesRead += mrPNGStream.Read( pPtr, mnChunkLen - nBytesRead );
+            } while ( ( nBytesRead < mnChunkLen ) && ( mrPNGStream.GetError() == ERRCODE_NONE ) );
+
+            nCRC32 = rtl_crc32( nCRC32, &rChunkData.aData[ 0 ], mnChunkLen );
             maDataIter = rChunkData.aData.begin();
         }
         sal_uInt32 nCheck;
