diff options
-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) |