mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
don't cache stream objects
This commit is contained in:
parent
5c06cd1de5
commit
378f381625
1 changed files with 7 additions and 6 deletions
13
pdf.js
13
pdf.js
|
@ -1262,12 +1262,9 @@ var XRef = (function() {
|
|||
fetch: function(ref) {
|
||||
var num = ref.num;
|
||||
var e = this.cache[num];
|
||||
if (e) {
|
||||
// The stream might be in use elsewhere, so clone it.
|
||||
if (IsStream(e))
|
||||
e = e.makeSubStream(e.start, e.length, e.dict);
|
||||
if (e)
|
||||
return e;
|
||||
}
|
||||
|
||||
e = this.getEntry(num);
|
||||
var gen = ref.gen;
|
||||
if (e.uncompressed) {
|
||||
|
@ -1292,7 +1289,11 @@ var XRef = (function() {
|
|||
}
|
||||
error("bad XRef entry");
|
||||
}
|
||||
return this.cache[num] = parser.getObj();
|
||||
e = parser.getObj();
|
||||
// Don't cache streams since they are mutable.
|
||||
if (!IsStream(e))
|
||||
this.cache[num] = e;
|
||||
return e;
|
||||
}
|
||||
error("compressed entry");
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue