From 39cb95f3d7cc41e247747e37afd05a9a6ce55115 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Mon, 10 Feb 2020 17:18:02 +0100 Subject: [PATCH] note a common real-world malformation we should accept-and-warn --- pdf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdf.c b/pdf.c index 9b58c23..2729f9a 100644 --- a/pdf.c +++ b/pdf.c @@ -662,6 +662,8 @@ init_parser(struct Env *aux) H_RULE(xr_td, SEQ(xrefs, KW("trailer"), ws, dict)); H_RULE(tail, SEQ(body, h_optional(xr_td), startxr)); + // XXX the real world likes to omit 'startxr' from all but the + // last trailer. we should accept-and-warn in that case. H_RULE(pdf, SEQ(header, h_many1(tail), end)); /* debug parser to consume as much as possible */ -- GitLab