summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2005-09-24 14:37:49 +0000
committerPierre Joye <pajoye@php.net>2005-09-24 14:37:49 +0000
commit97bad74c0fdf043253c7b3eabca11a0ecc4cebcf (patch)
treec772796f71187aadfb94868a893fdbbc60aa76ed
parentdc866850f7ebbbd6a52b46f62bd9228448363187 (diff)
downloadphp-git-97bad74c0fdf043253c7b3eabca11a0ecc4cebcf.tar.gz
- #33220, fix infinite loop while loading invalid gif, this patch fixes
at least many cases (nlopess)
-rw-r--r--ext/gd/libgd/gd_gif_in.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c
index 73f5e49c2d..1733a646f3 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -259,13 +259,13 @@ DoExtension(gdIOCtx *fd, int label, int *Transparent)
if ((buf[0] & 0x1) != 0)
*Transparent = buf[3];
- while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+ while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
default:
break;
}
- while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+ while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
@@ -337,7 +337,7 @@ GetCode_(gdIOCtx *fd, int code_size, int flag)
buf[0] = buf[last_byte-2];
buf[1] = buf[last_byte-1];
- if ((count = GetDataBlock(fd, &buf[2])) == 0)
+ if ((count = GetDataBlock(fd, &buf[2])) <= 0)
done = TRUE;
last_byte = 2 + count;