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 8c1e5f4 commit e0675fdCopy full SHA for e0675fd
src/io/mmap/arena.rs
@@ -106,17 +106,21 @@ impl<'a> Arena<'a> {
106
// each plane has to be mapped separately
107
let mut planes = Vec::new();
108
for plane in &v4l2_planes {
109
+ let length = if !self.buf_type.planar() {
110
+ v4l2_buf.length as usize
111
+ } else {
112
+ plane.length as usize
113
+ };
114
let ptr = v4l2::mmap(
115
ptr::null_mut(),
- plane.length as usize,
116
+ length,
117
libc::PROT_READ | libc::PROT_WRITE,
118
libc::MAP_SHARED,
119
self.handle.fd(),
120
plane.m.mem_offset as libc::off_t,
121
)?;
-
122
planes.push(slice::from_raw_parts_mut::<u8>(
- ptr as *mut u8, plane.length as usize
123
+ ptr as *mut u8, length,
124
));
125
}
126
0 commit comments