summaryrefslogtreecommitdiff
path: root/gs/Resource
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2011-10-02 22:26:58 -0400
committerAlex Cherepanov <alex.cherepanov@artifex.com>2011-10-02 22:26:58 -0400
commit8e6d888502506e061241f2cdeb7c3f76d4dfb04f (patch)
tree1966a5c069fd34ca173307bd0285790da8c26ef8 /gs/Resource
parent3380bef5e77ddfaa8aab496a4da13fd297480bd1 (diff)
Bug 692560: read objects with invalid obj# as nulls.
According to PDF spec, objects with invalid object numbers should be considered null objects. GS finally implements this.
Diffstat (limited to 'gs/Resource')
-rw-r--r--gs/Resource/Init/pdf_base.ps6
-rw-r--r--gs/Resource/Init/pdf_main.ps4
2 files changed, 7 insertions, 3 deletions
diff --git a/gs/Resource/Init/pdf_base.ps b/gs/Resource/Init/pdf_base.ps
index b542559bc..6b730e18c 100644
--- a/gs/Resource/Init/pdf_base.ps
+++ b/gs/Resource/Init/pdf_base.ps
@@ -758,8 +758,10 @@ currentdict /no_debug_dict undef
(%Resolving: ) print 2 copy 2 array astore //== exec
} if
} if
- 1 index 0 lt {
- ( **** Considering object with a negative number as null.\n) pdfformaterror
+ 1 index dup 0 lt exch NumObjects ge or {
+ ( **** Considering object with an invalid number )
+ 2 index 20 string cvs concatstrings
+ ( as null.\n) concatstrings pdfformaterror
pop pop //null
} {
1 index resolved? { % If object has already been resolved ...
diff --git a/gs/Resource/Init/pdf_main.ps b/gs/Resource/Init/pdf_main.ps
index d7db61b35..903949d2d 100644
--- a/gs/Resource/Init/pdf_main.ps
+++ b/gs/Resource/Init/pdf_main.ps
@@ -776,7 +776,7 @@ currentdict /xref-char-dict undef
/pdfopenfile { % <file> pdfopenfile <dict>
pdfdict readonly pop % can't do it any earlier than this
- 30 dict begin
+ 31 dict begin
/LocalResources 0 dict def
/DefaultQstate //null def % establish binding
/Printed where { pop } {
@@ -851,6 +851,8 @@ currentdict /xref-char-dict undef
} loop % Loop to previous trailer
} ifelse % Ifelse readxref stopped
+ /NumObjects Objects llength def % To check that obj# < NumObjects
+
% Scan numbers in the range 2147483648..4294967295 in Encrypt dictionary
% as unsigned integers for compatibility with Acrobat Reader. Bug 689010.
<< /PDFScanUnsigned //true >> setuserparams