From a954e4f267daa9d46c25ccc571cf64567cd3cf73 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 2 Sep 2012 11:54:47 +0200 Subject: Prevent recursive image soft masks from being loaded Print a warning instead and ignore the soft mask --- pdf/pdf_image.c | 10 ++++++---- 1 file 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)) { -- cgit v1.2.3