diff --git a/devices/src/virtio/video/command.rs b/devices/src/virtio/video/command.rs index 91aa244374..cb4d1cea63 100644 --- a/devices/src/virtio/video/command.rs +++ b/devices/src/virtio/video/command.rs @@ -160,6 +160,7 @@ impl<'a> VideoCmd { planes_layout, num_planes, plane_offsets, + num_entries, .. } = r.read_obj()?; @@ -181,6 +182,12 @@ impl<'a> VideoCmd { ); return Err(InvalidArgument); } + // We only support single-entry objects for now. + if num_planes != 1 || num_entries[0] != 1 { + error!("the number of entries must be equal to 1"); + return Err(InvalidArgument); + } + let plane_offsets = plane_offsets[0..num_planes as usize] .iter() .map(|x| Into::::into(*x))