summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_gd.c')
-rw-r--r--ext/gd/libgd/gd_gd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_gd.c b/ext/gd/libgd/gd_gd.c
index 55587d43e8..81a957d414 100644
--- a/ext/gd/libgd/gd_gd.c
+++ b/ext/gd/libgd/gd_gd.c
@@ -39,6 +39,9 @@ int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag)
if (!gdGetWord(&im->colorsTotal, in)) {
goto fail1;
}
+ if (im->colorsTotal > gdMaxColors) {
+ goto fail1;
+ }
}
/* Int to accommodate truecolor single-color transparency */
if (!gdGetInt(&im->transparent, in)) {