We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d858011 commit d0b5866Copy full SHA for d0b5866
src/texture.rs
@@ -169,6 +169,7 @@ impl Image {
169
/// Returns this image's data as a slice of 4-byte arrays.
170
pub fn get_image_data(&self) -> &[[u8; 4]] {
171
use std::slice;
172
+ assert!(self.width as usize * self.height as usize * 4 == self.bytes.len());
173
174
unsafe {
175
slice::from_raw_parts(
@@ -181,6 +182,7 @@ impl Image {
181
182
/// Returns this image's data as a mutable slice of 4-byte arrays.
183
pub fn get_image_data_mut(&mut self) -> &mut [[u8; 4]] {
184
185
186
187
188
slice::from_raw_parts_mut(
0 commit comments