diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-07-19 01:00:23 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-07-23 18:07:04 +0200 |
commit | e45df83bf0e7df8fc6e710fcdf6baee97863d780 (patch) | |
tree | f5d755b1ff17a77431f0281641d870c47eee025e /pdf | |
parent | e61ff8e87edaee5c3b1a85b7d08bd2c7ed2ecb38 (diff) | |
download | mupdf-e45df83bf0e7df8fc6e710fcdf6baee97863d780.tar.xz |
Handle pdf functions with too many inputs
Both exponential and stitching functions are limited to having one
input. Make sure that any excessive inputs are ignored.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_function.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pdf/pdf_function.c b/pdf/pdf_function.c index 978f2473..a0d0336b 100644 --- a/pdf/pdf_function.c +++ b/pdf/pdf_function.c @@ -1131,8 +1131,9 @@ load_exponential_func(fz_context *ctx, pdf_function *func, pdf_obj *dict) pdf_obj *obj; int i; - if (func->m != 1) - fz_throw(ctx, "/Domain must be one dimension (%d)", func->m); + if (func->m > 1) + fz_warn(ctx, "exponential functions have at most one input"); + func->m = 1; obj = pdf_dict_gets(dict, "N"); if (!pdf_is_int(obj) && !pdf_is_real(obj)) @@ -1212,8 +1213,9 @@ load_stitching_func(pdf_function *func, pdf_document *xref, pdf_obj *dict) func->u.st.k = 0; - if (func->m != 1) - fz_throw(ctx, "/Domain must be one dimension (%d)", func->m); + if (func->m > 1) + fz_warn(ctx, "stitching functions have at most one input"); + func->m = 1; obj = pdf_dict_gets(dict, "Functions"); if (!pdf_is_array(obj)) |