fix(svg): cast channel count for pixel budget arithmetic

This commit is contained in:
Nigel Ihza Firdausy committed 2026-10-14 23:18:25 +07:00
1 parent 6f46fcfc4a
commit 92647dd6ff
1 file changed
+1 -1
+1 -1
View File
@@ -331,7 +331,7 @@ impl Conv {
}
fn charge_pixels(&mut self, w: usize, h: usize) -> bool {
let bytes = (w as u64).saturating_mul(h as u64).saturating_mul(u64::from(self.fmt.channels()) * 4);
let bytes = (w as u64).saturating_mul(h as u64).saturating_mul(self.fmt.channels() as u64 * 4);
match self.pixel_budget.checked_sub(bytes) {
Some(remaining) => {
self.pixel_budget = remaining;