about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-01-14 08:03:10 -0600
committergennyble <gen@nyble.dev>2024-01-14 08:03:10 -0600
commitbb91402875b680c769ea84d82a76a639c21477ed (patch)
tree0384de23f4d1d225be81f98d50785ae23483ef6d
parent2719f8a6184bca7f4a0a5ef1336fc63dde0ebc87 (diff)
downloadgifed-bb91402875b680c769ea84d82a76a639c21477ed.tar.gz
gifed-bb91402875b680c769ea84d82a76a639c21477ed.zip
gifed: fix bug causing lzw encoder to crash
-rw-r--r--gifed/src/block/palette.rs2
1 files changed, 1 insertions, 1 deletions
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)
 	}