virtio: kumquat: slice length fix
Causes issues with some versions of host gfxstream. Reviewed-by: David Gilhooley <djgilhooley.gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
This commit is contained in:
committed by
Marge Bot
parent
f367cdad0a
commit
b8f0933b25
@@ -154,7 +154,7 @@ impl VirtGpuKumquat {
|
||||
pub fn get_caps(&self, capset_id: u32, slice: &mut [u8]) -> MesaResult<()> {
|
||||
let caps = self.capsets.get(&capset_id).ok_or(MesaError::Unsupported)?;
|
||||
let length = min(slice.len(), caps.len());
|
||||
slice.copy_from_slice(&caps[0..length]);
|
||||
slice[0..length].copy_from_slice(&caps[0..length]);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user