[virglrenderer-devel] [PATCH] vrend: never destroy context 0 in vrend_renderer_context_destroy

Marc-André Lureau mlureau at redhat.com
Thu Jan 5 17:26:42 UTC 2017


Hi

----- Original Message -----
> 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;
> > +

Looks good to me, perhaps add a comment here saying that context 0 is destroyed in vrend_decode_reset()?


> >     ctx = dec_ctx[handle];
> >     if (!ctx)
> >        return;
> > --
> > 2.7.4
> >
> >
> 


More information about the virglrenderer-devel mailing list