diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-11-21 13:16:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-11-21 13:19:53 +0100 |
commit | 5d63e681935fef00ca56f3e2114f0034b6c70a45 (patch) | |
tree | 1bffb502abe7ec6e61fd24ddc69ac32c90f7ae97 /vcl/source | |
parent | 3669c38a9c1e0405ec4b37ba57cee05cdbf91efc (diff) |
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
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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 ] ); } |