Browse Source

clone stream if we got it from the cache in case its already in use

Andreas Gal 14 years ago
parent
commit
fed7e723b8
  1. 7
      pdf.js

7
pdf.js

@ -1739,8 +1739,12 @@ var XRef = (function() { @@ -1739,8 +1739,12 @@ var XRef = (function() {
fetch: function(ref) {
var num = ref.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;
}
e = this.getEntry(num);
var gen = ref.gen;
if (e.uncompressed) {
@ -1810,7 +1814,6 @@ var Page = (function() { @@ -1810,7 +1814,6 @@ var Page = (function() {
height: mediaBox[3] - mediaBox[1] });
var args = [];
var map = gfx.map;
contents.reset(); // TODO support multiple display()s
var parser = new Parser(new Lexer(contents), false);
var obj;
while (!IsEOF(obj = parser.getObj())) {

Loading…
Cancel
Save