summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPNG.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-05-15 12:03:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-05-15 12:03:25 (GMT)
commit5f46d2f08eda1b81b09264e12b2fdf4a16342e2f (patch)
treed7433846c1d33380cb9149f5b8e05eff04629863 /generic/tkImgPNG.c
parent307c22d55990d4b2ff2981d1a37ef39f88aca78b (diff)
downloadtk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.zip
tk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.tar.gz
tk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.tar.bz2
Use assertion to prevent writing pixel lines beyond end of Photo image block.
Diffstat (limited to 'generic/tkImgPNG.c')
-rw-r--r--generic/tkImgPNG.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index d6a706a..8146e33 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -10,6 +10,7 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#include "assert.h"
#include "tkInt.h"
#define PNG_INT32(a,b,c,d) \
@@ -1880,6 +1881,8 @@ DecodeLine(
* Calculate offset into pixelPtr for the first pixel of the line.
*/
+ assert(pngPtr->currentLine < pngPtr->block.height);
+
offset = pngPtr->currentLine * pngPtr->block.pitch;
/*