1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #6194 from Rob--W/recover-mode-start-offset

Subtract start offset for xrefs in recovery mode
This commit is contained in:
Tim van der Meij 2015-07-11 17:22:08 +02:00
commit 7d4303b7c4
4 changed files with 38 additions and 3 deletions

View file

@ -1081,7 +1081,7 @@ var XRef = (function XRefClosure() {
} else if ((m = /^(\d+)\s+(\d+)\s+obj\b/.exec(token))) {
if (typeof this.entries[m[1]] === 'undefined') {
this.entries[m[1]] = {
offset: position,
offset: position - stream.start,
gen: m[2] | 0,
uncompressed: true
};
@ -1094,8 +1094,8 @@ var XRef = (function XRefClosure() {
var xrefTagOffset = skipUntil(content, 0, xrefBytes);
if (xrefTagOffset < contentLength &&
content[xrefTagOffset + 5] < 64) {
xrefStms.push(position);
this.xrefstms[position] = 1; // don't read it recursively
xrefStms.push(position - stream.start);
this.xrefstms[position - stream.start] = 1; // Avoid recursion
}
position += contentLength;