From bb91402875b680c769ea84d82a76a639c21477ed Mon Sep 17 00:00:00 2001 From: gennyble Date: Sun, 14 Jan 2024 08:03:10 -0600 Subject: gifed: fix bug causing lzw encoder to crash --- gifed/src/block/palette.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gifed/src/block/palette.rs b/gifed/src/block/palette.rs index 0dc1686..ea1ed0d 100644 --- a/gifed/src/block/palette.rs +++ b/gifed/src/block/palette.rs @@ -20,7 +20,7 @@ impl Palette { } pub fn lzw_code_size(&self) -> u8 { - let table_log = (self.table.len() as f32).log2() as u8; + let table_log = (self.table.len() as f32).log2().ceil() as u8; table_log.max(2) } -- cgit 1.4.1-3-g733a5