summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-11-07 17:01:53 +0400
committerFrediano Ziglio <freddy77@gmail.com>2024-06-12 12:40:33 +0100
commitf0eb8cc57dc10cbe3fa970b5b3f16bea378d9637 (patch)
tree2e2c62495ec6fd6b2b7c6c83e5439876b667209f
parent7e56fc9fd9f269c8cecc135fcd55d40b5db69af2 (diff)
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>
-rw-r--r--server/red-qxl.cpp5
-rw-r--r--server/red-worker.cpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/server/red-qxl.cpp b/server/red-qxl.cpp
index 1135fd52..2979ae61 100644
--- a/server/red-qxl.cpp
+++ b/server/red-qxl.cpp
@@ -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);
}
diff --git a/server/red-worker.cpp b/server/red-worker.cpp
index 912b7d55..3880531b 100644
--- a/server/red-worker.cpp
+++ b/server/red-worker.cpp
@@ -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);
}