|
|
|
@ -736,6 +736,12 @@ var XRef = (function XRefClosure() {
@@ -736,6 +736,12 @@ var XRef = (function XRefClosure() {
|
|
|
|
|
error('Invalid entry in XRef subsection: ' + first + ', ' + count); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The first xref table entry, i.e. obj 0, should be free. Attempting
|
|
|
|
|
// to adjust an incorrect first obj # (fixes issue 3248 and 7229).
|
|
|
|
|
if (i === 0 && entry.free && first === 1) { |
|
|
|
|
first = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!this.entries[i + first]) { |
|
|
|
|
this.entries[i + first] = entry; |
|
|
|
|
} |
|
|
|
@ -749,12 +755,6 @@ var XRef = (function XRefClosure() {
@@ -749,12 +755,6 @@ var XRef = (function XRefClosure() {
|
|
|
|
|
delete tableState.entryCount; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Per issue 3248: hp scanners generate bad XRef
|
|
|
|
|
if (first === 1 && this.entries[1] && this.entries[1].free) { |
|
|
|
|
// shifting the entries
|
|
|
|
|
this.entries.shift(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Sanity check: as per spec, first object must be free
|
|
|
|
|
if (this.entries[0] && !this.entries[0].free) { |
|
|
|
|
error('Invalid XRef table: unexpected first object'); |
|
|
|
|