diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-09-02 11:54:47 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-09-04 16:19:07 +0200 |
commit | a954e4f267daa9d46c25ccc571cf64567cd3cf73 (patch) | |
tree | 123a9e0c22be6b1f0e1663726eb61590e2912a4f | |
parent | 90907be6b1c119a6782748193a1fbf97396e51d0 (diff) | |
download | mupdf-a954e4f267daa9d46c25ccc571cf64567cd3cf73.tar.xz |
Prevent recursive image soft masks from being loaded
Print a warning instead and ignore the soft mask
-rw-r--r-- | pdf/pdf_image.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c index 249e2c65..1f0ae1e9 100644 --- a/pdf/pdf_image.c +++ b/pdf/pdf_image.c @@ -395,11 +395,13 @@ pdf_load_image_imp(pdf_document *xref, pdf_obj *rdb, pdf_obj *dict, fz_stream *c obj = pdf_dict_getsa(dict, "SMask", "Mask"); if (pdf_is_dict(obj)) { - /* Not allowed for inline images */ - if (!cstm) - { + /* Not allowed for inline images or soft masks */ + if (cstm) + fz_warn(ctx, "Ignoring invalid inline image soft mask"); + else if (forcemask) + fz_warn(ctx, "Ignoring recursive image soft mask"); + else mask = (fz_image *)pdf_load_image_imp(xref, rdb, obj, NULL, 1); - } } else if (pdf_is_array(obj)) { |