[virglrenderer-devel] [PATCH] vrend: never destroy context 0 in vrend_renderer_context_destroy
Li Qiang
liq3ea at gmail.com
Wed Jan 4 02:15:35 UTC 2017
Ping.
2016-12-29 16:41 GMT+08:00 Li Qiang <liq3ea at gmail.com>:
> 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.
>
> Signed-off-by: Li Qiang <liq3ea at gmail.com>
> ---
> src/vrend_decode.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/vrend_decode.c b/src/vrend_decode.c
> index 09f08ae..1bbcfda 100644
> --- a/src/vrend_decode.c
> +++ b/src/vrend_decode.c
> @@ -1089,6 +1089,10 @@ void vrend_renderer_context_destroy(uint32_t
> handle)
> if (handle >= VREND_MAX_CTX)
> return;
>
> + /* never destroy context 0 */
> + if (handle == 0)
> + return;
> +
> ctx = dec_ctx[handle];
> if (!ctx)
> return;
> --
> 2.7.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/virglrenderer-devel/attachments/20170104/2d6eefc3/attachment.html>
More information about the virglrenderer-devel
mailing list