diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-07-26 01:38:55 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-07-26 15:51:00 +0200 |
commit | e4517104c7465c39c86fb8c2eddcdc4cde48b248 (patch) | |
tree | 74b4ab91eed14406503f2d79080bdbc2783e09d2 /pdf/pdf_function.c | |
parent | 21ce8630a0ced3c8c167cb7a5cb583dfde896e32 (diff) | |
download | mupdf-e4517104c7465c39c86fb8c2eddcdc4cde48b248.tar.xz |
Assume default value for negative sample function dimension size
Diffstat (limited to 'pdf/pdf_function.c')
-rw-r--r-- | pdf/pdf_function.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pdf/pdf_function.c b/pdf/pdf_function.c index 09002ad0..eab7bedf 100644 --- a/pdf/pdf_function.c +++ b/pdf/pdf_function.c @@ -936,7 +936,14 @@ load_sample_func(pdf_function *func, pdf_document *xref, pdf_obj *dict, int num, if (pdf_array_len(obj) > func->m) fz_warn(ctx, "too many sample function dimension sizes"); for (i = 0; i < func->m; i++) + { func->u.sa.size[i] = pdf_to_int(pdf_array_get(obj, i)); + if (func->u.sa.size[i] < 0) + { + fz_warn(ctx, "negative sample function dimension size"); + func->u.sa.size[i] = 1; + } + } obj = pdf_dict_gets(dict, "BitsPerSample"); func->u.sa.bps = bps = pdf_to_int(obj); |