diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 6f712da06..026d8f6c7 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -1490,7 +1490,6 @@ impl MimeMessage { } #[expect(clippy::too_many_arguments)] - #[expect(clippy::arithmetic_side_effects)] async fn do_add_single_file_part( &mut self, context: &Context, @@ -1565,7 +1564,11 @@ impl MimeMessage { { match get_filemeta(decoded_data) { // image size is known, not too big, keep msg_type: - Ok((width, height)) if width * height <= constants::MAX_RCVD_IMAGE_PIXELS => { + Ok((width, height)) + if width + .checked_mul(height) + .is_some_and(|pixels| pixels <= constants::MAX_RCVD_IMAGE_PIXELS) => + { part.param.set_i64(Param::Width, width.into()); part.param.set_i64(Param::Height, height.into()); msg_type