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

Merge pull request #3376 from yurydelendik/bad-pdfs

Misc fixes for corrupted PDFs
This commit is contained in:
Brendan Dahl 2013-06-27 15:33:06 -07:00
commit f06dadab3b
5 changed files with 71 additions and 7 deletions

View file

@ -504,8 +504,11 @@ var FlateStream = (function FlateStreamClosure() {
if (typeof (b = bytes[bytesPos++]) == 'undefined')
error('Bad block header in flate stream');
check |= (b << 8);
if (check != (~blockLen & 0xffff))
if (check != (~blockLen & 0xffff) &&
(blockLen !== 0 || check !== 0)) {
// Ignoring error for bad "empty" block (see issue 1277)
error('Bad uncompressed block length in flate stream');
}
this.codeBuf = 0;
this.codeSize = 0;