summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_gd2.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_gd2.c')
-rw-r--r--ext/gd/libgd/gd_gd2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_gd2.c b/ext/gd/libgd/gd_gd2.c
index efc6ef47af..1794ca9e5a 100644
--- a/ext/gd/libgd/gd_gd2.c
+++ b/ext/gd/libgd/gd_gd2.c
@@ -150,6 +150,9 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
if (gdGetInt(&cidx[i].size, in) != 1) {
goto fail1;
}
+ if (cidx[i].offset < 0 || cidx[i].size < 0) {
+ goto fail1;
+ }
}
*chunkIdx = cidx;
}