mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Fixes compressed object entries caching
This commit is contained in:
parent
f76adca471
commit
725195b65f
3 changed files with 15 additions and 2 deletions
|
@ -701,7 +701,8 @@ var XRef = (function XRefClosure() {
|
|||
}
|
||||
|
||||
// compressed entry
|
||||
stream = this.fetch(new Ref(e.offset, 0));
|
||||
var tableOffset = e.offset;
|
||||
stream = this.fetch(new Ref(tableOffset, 0));
|
||||
if (!isStream(stream))
|
||||
error('bad ObjStm stream');
|
||||
var first = stream.parameters.get('First');
|
||||
|
@ -727,7 +728,11 @@ var XRef = (function XRefClosure() {
|
|||
// read stream objects for cache
|
||||
for (i = 0; i < n; ++i) {
|
||||
entries.push(parser.getObj());
|
||||
this.cache[nums[i]] = entries[i];
|
||||
num = nums[i];
|
||||
var entry = this.entries[num];
|
||||
if (entry && entry.offset === tableOffset && entry.gen === i) {
|
||||
this.cache[num] = entries[i];
|
||||
}
|
||||
}
|
||||
e = entries[e.gen];
|
||||
if (!e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue