summaryrefslogtreecommitdiffstats
path: root/generic/tkImgGIF.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2004-07-27 21:19:32 (GMT)
committerdas <das@noemail.net>2004-07-27 21:19:32 (GMT)
commit674c9394848542c3d0d635ae9a4aace1a32bc059 (patch)
tree24f58d9ef92d89aa7027c0ef78aaabf086d074b5 /generic/tkImgGIF.c
parent3b40a91dbfc8db1812765ee66962b55b6994699d (diff)
downloadtk-674c9394848542c3d0d635ae9a4aace1a32bc059.zip
tk-674c9394848542c3d0d635ae9a4aace1a32bc059.tar.gz
tk-674c9394848542c3d0d635ae9a4aace1a32bc059.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(). FossilOrigin-Name: d64990cb48173046d8a48e8e565c687a036392b7
Diffstat (limited to 'generic/tkImgGIF.c')
-rw-r--r--generic/tkImgGIF.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index c6d04d6..6fe8627 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.25 2003/03/06 15:05:31 dkf Exp $
+ * RCS: @(#) $Id: tkImgGIF.c,v 1.26 2004/07/27 21:19:32 das Exp $
*/
/*
@@ -327,11 +327,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) {