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)
commit876ca828dd8fd1fd9738b776566950373d6dd2c9 (patch)
treed7433846c1d33380cb9149f5b8e05eff04629863 /generic/tkImgPNG.c
parent292efe2ce7dea6f9212142f9ae7c3a91b181ed82 (diff)
downloadtk-876ca828dd8fd1fd9738b776566950373d6dd2c9.zip
tk-876ca828dd8fd1fd9738b776566950373d6dd2c9.tar.gz
tk-876ca828dd8fd1fd9738b776566950373d6dd2c9.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;
/*