diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-07-26 15:55:53 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-07-26 15:55:53 +0200 |
commit | 551e3a02c79acd6426994b0b198733789f4b4898 (patch) | |
tree | f246ba30cb2c568dbcc8db7e7c837e4c3ca736a0 /pdf/pdf_type3.c | |
parent | 5af5c027d1767a47f26d48df78596c2a8aa29805 (diff) | |
download | mupdf-551e3a02c79acd6426994b0b198733789f4b4898.tar.xz |
Handle negative or invalid character ranges in type3 fonts.
Add same guard clause as used for regular fonts.
Diffstat (limited to 'pdf/pdf_type3.c')
-rw-r--r-- | pdf/pdf_type3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index 2c18f698..bd60216d 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -106,6 +106,9 @@ pdf_load_type3_font(pdf_document *xref, pdf_obj *rdb, pdf_obj *dict) first = pdf_to_int(pdf_dict_gets(dict, "FirstChar")); last = pdf_to_int(pdf_dict_gets(dict, "LastChar")); + if (first < 0 || last > 255 || first > last) + first = last = 0; + widths = pdf_dict_gets(dict, "Widths"); if (!widths) { |