1 --- libgd-2.1.0/src/gd_gif_in.c.orig 2013-07-04 16:17:44.855925413 +0200
2 +++ libgd-2.1.0/src/gd_gif_in.c 2013-07-04 16:35:04.025881804 +0200
3 @@ -498,15 +498,16 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DAT
5 } else if(code == sd->end_code) {
7 + int max_count = 1024;
8 unsigned char buf[260];
14 - while((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0);
15 + while((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0 && (--max_count >= 0));
18 + if((count != 0) || (max_count < 0)) {