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

#2098: scanning for stream length when it's incorrect

This commit is contained in:
Yury Delendik 2013-06-22 13:21:19 -05:00
parent c3096d98d4
commit 4d9ee7b530
3 changed files with 55 additions and 2 deletions

View file

@ -141,6 +141,12 @@ var ChunkedStream = (function ChunkedStreamClosure() {
return bytes.subarray(pos, end);
},
peekBytes: function ChunkedStream_peekBytes(length) {
var bytes = this.getBytes(length);
this.pos -= bytes.length;
return bytes;
},
getByteRange: function ChunkedStream_getBytes(begin, end) {
this.ensureRange(begin, end);
return this.bytes.subarray(begin, end);