Tweak the flate end_of_block check.

This commit is contained in:
Nigel Tao committed 2017-11-04 14:54:56 +11:00
1 parent aa1f0078db
commit 8fafcbcb31
2 files changed
+15 -8

No files matched your search

+7 -4
View File
@@ -201,11 +201,14 @@ pri func flate_decoder.decode_blocks?(dst writer1, src reader1)() {
this.end_of_block = false
this.decode_huffman_fast?(dst:in.dst, src:in.src)
// TODO: check this.end_of_block.
this.decode_huffman_slow?(dst:in.dst, src:in.src)
if not this.end_of_block {
return error "internal error: inconsistent Huffman end_of_block"
if this.end_of_block {
continue
}
this.decode_huffman_slow?(dst:in.dst, src:in.src)
if this.end_of_block {
continue
}
return error "internal error: inconsistent Huffman end_of_block"
}
}