codec/picture: fix .data() and .data_mut()
This commit is contained in:
parent
f0b11a960a
commit
068d42cbb8
@ -110,7 +110,7 @@ impl<'a> Picture<'a> {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
for (i, length) in (*self.ptr).linesize.iter().take_while(|l| **l > 0).enumerate() {
|
for (i, length) in (*self.ptr).linesize.iter().take_while(|l| **l > 0).enumerate() {
|
||||||
result.push(slice::from_raw_parts((*self.ptr).data[i], *length as usize))
|
result.push(slice::from_raw_parts((*self.ptr).data[i], (*length as usize) * (self.height as usize)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ impl<'a> Picture<'a> {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
for (i, length) in (*self.ptr).linesize.iter().take_while(|l| **l > 0).enumerate() {
|
for (i, length) in (*self.ptr).linesize.iter().take_while(|l| **l > 0).enumerate() {
|
||||||
result.push(slice::from_raw_parts_mut((*self.ptr).data[i], *length as usize))
|
result.push(slice::from_raw_parts_mut((*self.ptr).data[i], (*length as usize) * (self.height as usize)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user