[Libreoffice-commits] core.git: vcl/source

Stephan Bergmann sbergman at redhat.com
Tue Nov 21 12:20:17 UTC 2017


 vcl/source/gdi/pngread.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 5d63e681935fef00ca56f3e2114f0034b6c70a45
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 21 13:16:08 2017 +0100

    assert that mnPngDepth can only be 16 here
    
    ...due to how PNGReaderImpl::ImplReadHeader sets up the various PNGReaderImpl
    data members.  Shows that the "(and, TODO, also in the mbAlphaChannel case)?"
    from bb11e1283e3d49ec1bfe14c4271edbd49af3e3c1 "ASan heap-buffer-overflow" does
    not need any further fixes.
    
    Change-Id: Ie942e22dc67b2704c7c74b7b70e474b34173e9d1

diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 7a1f8ef46136..619a12aaa0cd 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <cassert>
 #include <memory>
 #include <vcl/pngread.hxx>
 
@@ -1317,6 +1320,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd )
                     }
                     else
                     {
+                        assert(mnPngDepth == 16);
                         for ( long nX = nXStart; nX < maOrigSize.Width(); nX += nXAdd, pTmp += 4 )
                             ImplSetAlphaPixel( nY, nX, pTmp[ 0 ], pTmp[ 2 ] );
                     }


More information about the Libreoffice-commits mailing list