clone stream if we got it from the cache in case its already in use
This commit is contained in:
parent
76e43dd982
commit
fed7e723b8
7
pdf.js
7
pdf.js
@ -1739,8 +1739,12 @@ var XRef = (function() {
|
|||||||
fetch: function(ref) {
|
fetch: function(ref) {
|
||||||
var num = ref.num;
|
var num = ref.num;
|
||||||
var e = this.cache[num];
|
var e = this.cache[num];
|
||||||
if (e)
|
if (e) {
|
||||||
|
// The stream might be in use elsewhere, so clone it.
|
||||||
|
if (IsStream(e))
|
||||||
|
e = e.makeSubStream(0);
|
||||||
return e;
|
return e;
|
||||||
|
}
|
||||||
e = this.getEntry(num);
|
e = this.getEntry(num);
|
||||||
var gen = ref.gen;
|
var gen = ref.gen;
|
||||||
if (e.uncompressed) {
|
if (e.uncompressed) {
|
||||||
@ -1810,7 +1814,6 @@ var Page = (function() {
|
|||||||
height: mediaBox[3] - mediaBox[1] });
|
height: mediaBox[3] - mediaBox[1] });
|
||||||
var args = [];
|
var args = [];
|
||||||
var map = gfx.map;
|
var map = gfx.map;
|
||||||
contents.reset(); // TODO support multiple display()s
|
|
||||||
var parser = new Parser(new Lexer(contents), false);
|
var parser = new Parser(new Lexer(contents), false);
|
||||||
var obj;
|
var obj;
|
||||||
while (!IsEOF(obj = parser.getObj())) {
|
while (!IsEOF(obj = parser.getObj())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user