Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transpose: Fix invalid_reference_casting errors
Fixes this build error with current Rust nightly: error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused --> imageflow_core/src/graphics/transpose.rs:122:13 | 122 | *(&mut *(*to).pixels.offset( | _____________^______- | |_____________| | || 123 | || x.wrapping_mul(4u32) 124 | || .wrapping_add(y.wrapping_mul((*to).stride)) as isize, 125 | || ) as *mut libc::c_uchar as *mut u32) = *(&mut *(*from).pixels.offset( | ||_____________- backing allocation comes from here ... | 128 | | ) as *mut libc::c_uchar 129 | | as *mut u32); | |_____________________________^ | = note: casting from `u8` (1 bytes) to `u32` (4 bytes) = note: `#[deny(invalid_reference_casting)]` on by default Signed-off-by: Anders Kaseorg <[email protected]>
- Loading branch information