Warn on invalid surface_id at qxl_spice_destroy_surface_wait()

Fixes:
https://gitlab.freedesktop.org/spice/spice/-/issues/83

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
Marc-André Lureau 2023-11-07 17:01:53 +04:00 committed by Frediano Ziglio
parent 7e56fc9fd9
commit f0eb8cc57d
2 changed files with 5 additions and 2 deletions

View File

@ -267,6 +267,11 @@ void spice_qxl_destroy_surface_wait(QXLInstance *instance, uint32_t surface_id)
{
RedWorkerMessageDestroySurfaceWait payload;
if (surface_id != 0) {
spice_warning("Invalid surface_id != 0: %u", surface_id);
return;
}
payload.surface_id = surface_id;
instance->st->send_message(payload);
}

View File

@ -364,8 +364,6 @@ handle_dev_del_memslot(RedWorker* worker, RedWorkerMessageDelMemslot* msg)
static void
handle_dev_destroy_surface_wait(RedWorker* worker, RedWorkerMessageDestroySurfaceWait* msg)
{
spice_return_if_fail(msg->surface_id == 0);
flush_all_qxl_commands(worker);
display_channel_destroy_surface_wait(worker->display_channel, msg->surface_id);
}