From: Akihiko Odaki <[email protected]>
Reject a blob that lacks the backing storage for
VIRTIO_GPU_CMD_UPDATE_CURSOR.
Fixes: bdd53f739273 ("virtio-gpu: Update cursor data using blob")
Signed-off-by: Akihiko Odaki <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-ID: <[email protected]>
---
hw/display/virtio-gpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 7f3301a9ac57..01549d29d8a2 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -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;
--
2.55.0.543.g5ebe2ebe4ea8