Merge pull request #1031 from Kelimion/zlib_fix

ZLIB: fix.
This commit is contained in:
Jeroen van Rijn
2021-06-21 22:16:56 +02:00
committed by GitHub
+3 -15
View File
@@ -360,13 +360,9 @@ parse_huffman_block :: proc(z: ^Context, z_repeat, z_offset: ^Huffman_Table) ->
Replicate the last outputted byte, length times.
*/
if length > 0 {
if offset >= 0 && offset < z.window_size {
c := z.last[offset];
e := repl_byte(z, length, c);
if e != .None {
return E_General.Output_Too_Short;
}
} else {
c := z.last[offset & z.window_mask];
e := repl_byte(z, length, c);
if e != .None {
return E_General.Output_Too_Short;
}
}
@@ -376,14 +372,6 @@ parse_huffman_block :: proc(z: ^Context, z_repeat, z_offset: ^Huffman_Table) ->
if e != .None {
return E_General.Output_Too_Short;
}
// #no_bounds_check for _ in 0..<length {
// b, e := compress.peek_back_byte(z, offset);
// if e != .None {
// return E_General.Output_Too_Short;
// }
// write_byte(z, b);
// offset += 1;
// }
}
}
}