#1277: ignoring error for bad "empty" block

This commit is contained in:
Yury Delendik 2013-06-22 14:07:04 -05:00
parent 4d9ee7b530
commit aac0f80aad

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;