From 118a9b627f97e45b94a1aa3ef716f2eace9ee34e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 15 Nov 2026 00:35:33 +0000 Subject: [PATCH] fix(render): use integer divisibility helper --- crates/render/src/paint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/render/src/paint.rs b/crates/render/src/paint.rs index 5ee5055c53..4dd1253bee 100644 --- a/crates/render/src/paint.rs +++ b/crates/render/src/paint.rs @@ -303,7 +303,7 @@ fn png_row_scratch(hdr: &craft_image_codecs::PngHeader) -> Option { /// the PNG header says it is a static, non-interlaced image, the format the renderer can stream. fn png_row_scratch_from_header(bytes: &[u8], width: u32, height: u32, total_bytes: u64) -> Option { const SIG: &[u8; 8] = b"\x89PNG\r\n\x1a\n"; - if bytes.get(..8)? != SIG || height == 0 || total_bytes % u64::from(height) != 0 { + if bytes.get(..8)? != SIG || height == 0 || !total_bytes.is_multiple_of(u64::from(height)) { return None; } let mut at = 8usize;