From ce36a53fa0e18c0f3798a5ad7048148512e7d436 Mon Sep 17 00:00:00 2001 From: Pompolic <pompolic@special-circumstanc.es> Date: Fri, 14 Feb 2020 16:21:00 +0100 Subject: [PATCH] FIX: whitespace preceding hex digit optional and should be ignored --- pdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf.c b/pdf.c index 40223ec..b46e3f0 100644 --- a/pdf.c +++ b/pdf.c @@ -1072,7 +1072,7 @@ ASCIIHexDecode(const Dict *parms, HBytes b, HParser *p) H_ARULE(hupper, h_ch_range('A', 'F')); H_RULE(ahexeod, h_ch('>')); H_RULE(hdigit, CHX(digit, hlower, hupper)); - H_RULE(hdigitpair, SEQ(h_many(CHX(lwchar,hdigit)),h_many(CHX(lwchar,hdigit)))); + H_RULE(hdigitpair, SEQ(OPT(h_many(lwchar)),hdigit,OPT(h_many(lwchar)),hdigit)); H_ARULE(ahextruncated, SEQ(hdigit,ahexeod)); H_RULE(hs_end, CHX(hdigitpair, ahextruncated)); -- GitLab