summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_jpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_jpeg.c')
-rw-r--r--ext/gd/libgd/gd_jpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c
index a2b8b62d90..ce5d84a0fb 100644
--- a/ext/gd/libgd/gd_jpeg.c
+++ b/ext/gd/libgd/gd_jpeg.c
@@ -328,6 +328,11 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
php_gd_error("gd-jpeg: warning: jpeg_finish_decompress reports suspended data source");
}
+ /* Thanks to Truxton Fulton */
+ if (cinfo.err->num_warnings > 0) {
+ goto error;
+ }
+
jpeg_destroy_decompress (&cinfo);
gdFree (row);