File 0010-0a5dff15-vrend-never-destroy-context-0-in-vrend_renderer_cont.patch of Package virglrenderer
From 0a5dff15912207b83018485f83e067474e818bab Mon Sep 17 00:00:00 2001
From: Li Qiang <liq3ea@gmail.com>
Date: Thu, 5 Jan 2017 18:02:46 -0800
Subject: [PATCH] vrend: never destroy context 0 in
vrend_renderer_context_destroy
There will be a crash if the guest destroy context 0. As the context 0 is
allocate in renderer init, not destroy in vrend_renderer_context_destroy.
The context will be freed in renderer fini by calling vrend_decode_reset.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Index: virglrenderer-0.5.0/src/vrend_decode.c
===================================================================
--- virglrenderer-0.5.0.orig/src/vrend_decode.c
+++ virglrenderer-0.5.0/src/vrend_decode.c
@@ -1096,6 +1096,11 @@ void vrend_renderer_context_destroy(uint
if (handle >= VREND_MAX_CTX)
return;
+ /* never destroy context 0 here, it will be destroyed in vrend_decode_reset()*/
+ if (handle == 0) {
+ return;
+ }
+
ctx = dec_ctx[handle];
if (!ctx)
return;