diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-05 20:39:00 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 14:03:36 +0200 |
commit | 30cea356bb6b5038e7eee642eccb8cf185945a40 (patch) | |
tree | 50d843554f8abe09380a116f1e94b95e005527ba | |
parent | 697c3cfb34d0b6fe315fc4d303340275ab80c121 (diff) | |
download | mupdf-30cea356bb6b5038e7eee642eccb8cf185945a40.tar.xz |
Only warn on stitching function's sub function with wrong arity
Sub functions that make up a stitching function can be evaluated with
the wrong number of inputs/outputs, so it is not necessary to throw an
exception if the number of inputs/outputs do not match when loading
sub functions.
-rw-r--r-- | pdf/pdf_function.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pdf/pdf_function.c b/pdf/pdf_function.c index 18c16669..590ca626 100644 --- a/pdf/pdf_function.c +++ b/pdf/pdf_function.c @@ -1256,16 +1256,17 @@ load_stitching_func(pdf_function *func, pdf_document *xref, pdf_obj *dict) sub = pdf_array_get(obj, i); funcs[i] = pdf_load_function(xref, sub, 1, func->n); /* RJW: "cannot load sub function %d (%d %d R)", i, pdf_to_num(sub), pdf_to_gen(sub) */ - if (funcs[i]->m != 1 || funcs[i]->n != funcs[0]->n) - fz_throw(ctx, "sub function %d /Domain or /Range mismatch", i); func->size += pdf_function_size(funcs[i]); func->u.st.k ++; - } - if (func->n != funcs[0]->n) - fz_throw(ctx, "sub function /Domain or /Range mismatch"); + if (funcs[i]->m != func->m) + fz_warn(ctx, "sub function %d has too few/many inputs", i); + if (funcs[i]->n != func->n) + fz_warn(ctx, "sub function %d has too few/many outputs", i); + } } + obj = pdf_dict_gets(dict, "Bounds"); if (!pdf_is_array(obj)) fz_throw(ctx, "stitching function has no bounds"); |