commit f0c8a4732e52479072004950a488c09a892c0d58 from: Sven M. Hallberg date: Fri Apr 14 11:45:23 2023 UTC correctly look for /Root in the last trailer section A mistake snuck into commit 76e546ce, taking the last element of the xrefs array as the "last" trailer section. But the array is filled in reverse order by following the chain of startxref and /Prev pointers, so the (logical) last/latest section is xrefs[0]. commit - 06ed0943b4ffd56be1323c336f0cb52379ccd6d1 commit + f0c8a4732e52479072004950a488c09a892c0d58 blob - b3101781628c5c931c9a0750970592b9f7721710 blob + a7697b557e16a68b17e9e2d35c808a22d0e509fa --- pdf.c +++ pdf.c @@ -4367,7 +4367,7 @@ process_page_content(struct Env *aux) /* find the last trailer dictionary */ if (aux->nxrefs == 0) return; - tok = aux->xrefs[aux->nxrefs - 1]; /* last xref section */ + tok = aux->xrefs[0]; /* first element is latest (reverse order) */ trailer = H_INDEX(Dict, tok, 1); /* fetch Size (a required field) from the trailer dictionary */