diff options
author | dgp <dgp@users.sourceforge.net> | 2015-05-15 12:03:25 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-05-15 12:03:25 (GMT) |
commit | 5f46d2f08eda1b81b09264e12b2fdf4a16342e2f (patch) | |
tree | d7433846c1d33380cb9149f5b8e05eff04629863 | |
parent | 307c22d55990d4b2ff2981d1a37ef39f88aca78b (diff) | |
download | tk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.zip tk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.tar.gz tk-5f46d2f08eda1b81b09264e12b2fdf4a16342e2f.tar.bz2 |
Use assertion to prevent writing pixel lines beyond end of Photo image block.
-rw-r--r-- | generic/tkImgPNG.c | 3 |
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; /* |