diff options
author | das <das> | 2004-07-27 20:31:01 (GMT) |
---|---|---|
committer | das <das> | 2004-07-27 20:31:01 (GMT) |
commit | 05404c9f8c086384d48880c8e4e07243443b4f23 (patch) | |
tree | 8615b636a3c9eab7a362e4519a18d3e70a6cfee7 | |
parent | 42ad4e15c28ba0952715b1cb1d341f58f150618a (diff) | |
download | tk-05404c9f8c086384d48880c8e4e07243443b4f23.zip tk-05404c9f8c086384d48880c8e4e07243443b4f23.tar.gz tk-05404c9f8c086384d48880c8e4e07243443b4f23.tar.bz2 |
* generic/tkImgGIF.c (FileReadGIF): fix crash reported by Reinhard Max:
in case of premature end of image data, return error instead of
passing nil buffer to Tk_PhotoPutBlock().
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | generic/tkImgGIF.c | 9 |
2 files changed, 9 insertions, 4 deletions
@@ -2,6 +2,10 @@ *** 8.4.7 TAGGED FOR RELEASE *** + * generic/tkImgGIF.c (FileReadGIF): fix crash reported by Reinhard Max: + in case of premature end of image data, return error instead of + passing nil buffer to Tk_PhotoPutBlock(). + * generic/tkRectOval.c (ComputeRectOvalBbox): Mac OS X specific fix to rounding in bounding box 'bloat' calculation to avoid drawing outside of bounding box when CG drawing enabled. Fix probably diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 1f4a79b..8dbca04 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -29,7 +29,7 @@ * | provided "as is" without express or implied warranty. | * +-------------------------------------------------------------------+ * - * RCS: @(#) $Id: tkImgGIF.c,v 1.24 2003/02/20 15:28:40 dkf Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.24.2.1 2004/07/27 20:31:02 das Exp $ */ /* @@ -324,11 +324,12 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY, while (1) { if (Fread(buf, 1, 1, chan) != 1) { /* - * Premature end of image. We should really notify - * the user, but for now just show garbage. + * Premature end of image. */ - break; + Tcl_AppendResult(interp,"premature end of image data for this index", + (char *) NULL); + goto error; } if (buf[0] == GIF_TERMINATOR) { |