hw/display/virtio-gpu: Check cursor data presence
Reject a blob that lacks the backing storage for
VIRTIO_GPU_CMD_UPDATE_CURSOR.
Fixes: bdd53f7392 ("virtio-gpu: Update cursor data using blob")
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260825-dmabuf-v2-4-b3d64d3b9a0e@rsg.ci.i.u-tokyo.ac.jp>
This commit is contained in:
1 parent
cd71534b22
commit
d3c2da174c
1 file changed
+2
-2
@@ -63,8 +63,8 @@ void virtio_gpu_update_cursor_data(VirtIOGPU *g,
|
||||
}
|
||||
data = pixman_image_get_data(res->image);
|
||||
} else {
|
||||
if (res->blob_size < (s->current_cursor->width *
|
||||
s->current_cursor->height * 4)) {
|
||||
if (!res->iov || res->blob_size < (s->current_cursor->width *
|
||||
s->current_cursor->height * 4)) {
|
||||
return;
|
||||
}
|
||||
data = res->blob;
|
||||
|
||||
Reference in new issue
Block a user