I opened the door to grotty (virused ?) gifs too far, this closes it a little. Reference: /n/sources/patch/applied/gif-robustness Date: Fri Mar 24 13:17:40 CET 2006 Signed-off-by: steve@quintile.net --- /sys/src/cmd/jpg/readgif.c Fri Mar 24 13:13:08 2006 +++ /sys/src/cmd/jpg/readgif.c Fri Mar 24 13:13:05 2006 @@ -451,7 +451,7 @@ fprint(2, "ReadGIF: GIF invalid, code out of range, %x > %x\n", code, nentry); code = nentry; } - for(c=code; c>=0; c=tbl[c].prefix) + for(c=code; stacki>0 && c>=0; c=tbl[c].prefix) stack[stacki--] = tbl[c].exten; nb = (sizeof stack)-(stacki+1);