mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Allow an LZW literal width of 1
This commit is contained in:
1 parent
d1133b105e
commit
5bea867f72
4 files changed
+63
-6
No files matched your search
@@ -69,7 +69,7 @@ pub struct decoder?(
|
||||
output array[8192 + 7] base.u8,
|
||||
)
|
||||
|
||||
pub func decoder.set_literal_width!(lw base.u32[2..8]) {
|
||||
pub func decoder.set_literal_width!(lw base.u32[1..8]) {
|
||||
this.set_literal_width_arg = args.lw
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workb
|
||||
|
||||
// Initialize read_from state.
|
||||
this.literal_width = 8
|
||||
if this.set_literal_width_arg >= 2 {
|
||||
if this.set_literal_width_arg > 0 {
|
||||
this.literal_width = this.set_literal_width_arg
|
||||
}
|
||||
this.clear_code = (1 as base.u32) << this.literal_width
|
||||
|
||||
Reference in new issue
Block a user