Skip to content

Commit

Permalink
ioctl/qbuf: only copy necessary amount of planes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Mar 9, 2023
1 parent 7ece9fd commit 270a0be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/ioctl/qbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ impl QBuf for V4l2Buffer {
v4l2_planes: &mut V4l2BufferPlanes,
) -> Result<(), QBufError> {
*v4l2_buf = self.buffer;
for (dest, src) in v4l2_planes.iter_mut().zip(self.planes.iter()) {
for (dest, src) in v4l2_planes
.iter_mut()
.zip(self.planes.iter())
.take(v4l2_buf.length as usize)
{
*dest = *src;
}

Expand Down

0 comments on commit 270a0be

Please sign in to comment.