diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 14:14:19 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 14:14:19 +0200 |
commit | 1ce75e79683b5df7046bdddbc0dad4b11805a73b (patch) | |
tree | 8f75ccdc08a6c6f6f9c0b7b956eb2f777f2e91c0 | |
parent | 23f97fdf96e65173def430f88a76df1c85d8339e (diff) | |
download | mupdf-1ce75e79683b5df7046bdddbc0dad4b11805a73b.tar.xz |
Handle out of range encoding differences for type3 fonts
Thanks to Zeniko for pointing out this fix.
-rw-r--r-- | pdf/pdf_font.c | 2 | ||||
-rw-r--r-- | pdf/pdf_type3.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c index d43d45d4..4f630184 100644 --- a/pdf/pdf_font.c +++ b/pdf/pdf_font.c @@ -546,7 +546,7 @@ pdf_load_simple_font(pdf_document *xref, pdf_obj *dict) item = pdf_array_get(diff, i); if (pdf_is_int(item)) k = pdf_to_int(item); - if (pdf_is_name(item) && k >= 0 && k < 256) + if (pdf_is_name(item) && k >= 0 && k < nelem(estrings)) estrings[k++] = pdf_to_name(item); } } diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index aaf47872..4fc7803e 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -87,9 +87,8 @@ pdf_load_type3_font(pdf_document *xref, pdf_obj *rdb, pdf_obj *dict) item = pdf_array_get(diff, i); if (pdf_is_int(item)) k = pdf_to_int(item); - if (pdf_is_name(item)) + if (pdf_is_name(item) && k >= 0 && k < nelem(estrings)) estrings[k++] = pdf_to_name(item); - k = fz_clampi(k, 0, 255); } } } |