From 551e3a02c79acd6426994b0b198733789f4b4898 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 26 Jul 2012 15:55:53 +0200 Subject: Handle negative or invalid character ranges in type3 fonts. Add same guard clause as used for regular fonts. --- pdf/pdf_type3.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- cgit v1.2.3