mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Prevent infinite loop when scanning for endstream (bug 1020226)
This commit is contained in:
parent
806aa36aa8
commit
26bbcedcae
1 changed files with 3 additions and 0 deletions
|
@ -266,6 +266,9 @@ var Parser = (function ParserClosure() {
|
|||
while (stream.pos < stream.end) {
|
||||
var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE);
|
||||
var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH;
|
||||
if (scanLength <= 0) {
|
||||
break;
|
||||
}
|
||||
found = false;
|
||||
for (i = 0, j = 0; i < scanLength; i++) {
|
||||
var b = scanBytes[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue