summaryrefslogtreecommitdiff
path: root/pdf/pdf_type3.c
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/pdf_type3.c')
-rw-r--r--pdf/pdf_type3.c3
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)
{