From 5f46d2f08eda1b81b09264e12b2fdf4a16342e2f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 May 2015 12:03:25 +0000 Subject: Use assertion to prevent writing pixel lines beyond end of Photo image block. --- generic/tkImgPNG.c | 3 +++ 1 file changed, 3 insertions(+) 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; /* -- cgit v0.12