summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-21 13:16:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-21 13:19:53 +0100
commit5d63e681935fef00ca56f3e2114f0034b6c70a45 (patch)
tree1bffb502abe7ec6e61fd24ddc69ac32c90f7ae97
parent3669c38a9c1e0405ec4b37ba57cee05cdbf91efc (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
-rw-r--r--vcl/source/gdi/pngread.cxx4
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 ] );
}