diff --git a/src/lossless.rs b/src/lossless.rs index aa21ebc..ac3c6c0 100644 --- a/src/lossless.rs +++ b/src/lossless.rs @@ -626,7 +626,8 @@ impl HuffmanInfo { if self.bits == 0 { return 0; } - let position = usize::from((y >> self.bits) * self.xsize + (x >> self.bits)); + let position = + usize::from(y >> self.bits) * usize::from(self.xsize) + usize::from(x >> self.bits); let meta_huff_code: usize = self.image[position].try_into().unwrap(); meta_huff_code }