From 5d63e681935fef00ca56f3e2114f0034b6c70a45 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 21 Nov 2017 13:16:08 +0100 Subject: 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 --- vcl/source/gdi/pngread.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl') 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 + +#include #include #include @@ -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 ] ); } -- cgit v1.2.3