(attr: &liq_attr, width: u32, height: u32)
| 579 | } |
| 580 | |
| 581 | pub(crate) fn check_image_size(attr: &liq_attr, width: u32, height: u32) -> bool { |
| 582 | if bad_object!(attr, LIQ_ATTR_MAGIC) { return false; } |
| 583 | |
| 584 | if width == 0 || height == 0 { |
| 585 | return false; |
| 586 | } |
| 587 | |
| 588 | if width as usize > c_int::MAX as usize / std::mem::size_of::<liq_color>() / height as usize || |
| 589 | width as usize > c_int::MAX as usize / 16 / std::mem::size_of::<f32>() || |
| 590 | height as usize > c_int::MAX as usize / std::mem::size_of::<usize>() |
| 591 | { |
| 592 | return false; |
| 593 | } |
| 594 | true |
| 595 | } |
| 596 | |
| 597 | #[no_mangle] |
| 598 | #[inline(never)] |
no outgoing calls
no test coverage detected