diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2013-06-18 12:02:01 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2013-06-18 12:02:01 +0100 |
commit | 95cd6ab8bf3a8866a5a10571a0c034869a4ba064 (patch) | |
tree | 02f7016ca355830ecb992abaeef7c321e108bbce | |
parent | bd2887990301b12c2b11df323ee726855129a637 (diff) | |
download | ghostpdl-95cd6ab8bf3a8866a5a10571a0c034869a4ba064.tar.gz |
PDF interpreter - handle empty cref by rebuilding it.
Bug #694342 "Error: /typecheck in --run-- reading PDF file"
The PDF interpreter didn't notice that an empty xref (the xref token
immediately followed by the trailer token) was not a valid xref. Later we
would attempt to use the empty xref, and fail.
We now check the length of 'Objects' when we find the trailer token and if
it is 0 we throw an error. This causes the PDF itnerpreter to rebuild the
xref table by rescanning the whole file.
-rw-r--r-- | gs/Resource/Init/pdf_main.ps | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gs/Resource/Init/pdf_main.ps b/gs/Resource/Init/pdf_main.ps index 86d54dbe1..0d23de030 100644 --- a/gs/Resource/Init/pdf_main.ps +++ b/gs/Resource/Init/pdf_main.ps @@ -458,7 +458,7 @@ pdfdict begin pop % We do not need the position. 0 % Initialize xref table error counter { PDFfile token pop % first object # or trailer - dup /trailer eq { pop exit } if + dup /trailer eq { pop Objects llength 0 eq {/setxrefentry cvx /syntaxerror signalerror} {exit} ifelse } if PDFfile token pop % entry count % remaining must be whitespace only (otherwise this xref Size was invalid. |