diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-01-06 12:33:11 +0000 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2012-01-06 13:49:24 +0000 |
commit | dcdb116ea172b2954d42304238f32183263ddfed (patch) | |
tree | d8eb0abf6533baa3fb794de519b4d835009811cc | |
parent | 9bda8c7e42724ab709cc1552a1e79a181ccb3fc5 (diff) | |
download | mupdf-dcdb116ea172b2954d42304238f32183263ddfed.tar.xz |
Catch errors with impossibly wide images.
Thanks to Zeniko for pointing this out.
-rw-r--r-- | fitz/res_pixmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index ff1bbeb4..008781b4 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -59,6 +59,8 @@ fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h { fz_try(ctx) { + if (pix->w + pix->n - 1 > INT_MAX / pix->n) + fz_throw(ctx, "overly wide image"); pix->samples = fz_malloc_array(ctx, pix->h, pix->w * pix->n); } fz_catch(ctx) |