1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Fixes compressed object entries caching

This commit is contained in:
Yury Delendik 2012-11-03 23:03:52 -05:00
parent f76adca471
commit 725195b65f
3 changed files with 15 additions and 2 deletions

View file

@ -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) {