blob: 7c5eb796eac2ffcdcda79781c6ef483a52b7f7f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
diff --git a/gfx/qcms/src/iccread.rs b/gfx/qcms/src/iccread.rs
--- a/gfx/qcms/src/iccread.rs
+++ b/gfx/qcms/src/iccread.rs
@@ -229,7 +229,7 @@
read_u16(mem, offset)
}
pub fn write_u32(mem: &mut [u8], offset: usize, value: u32) {
- if offset <= mem.len() - std::mem::size_of_val(&value) {
+ if offset > mem.len() - std::mem::size_of_val(&value) {
panic!("OOB");
}
let mem = mem.as_mut_ptr();
@@ -238,7 +238,7 @@
}
}
pub fn write_u16(mem: &mut [u8], offset: usize, value: u16) {
- if offset <= mem.len() - std::mem::size_of_val(&value) {
+ if offset > mem.len() - std::mem::size_of_val(&value) {
panic!("OOB");
}
let mem = mem.as_mut_ptr();
|