vrend: fix a leak in context create internal

Create a context more than once causes memory leak issue.
Juest return if the context exists.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Li Qiang 8 years ago committed by Dave Airlie
parent 40b0e78133
commit 747a293ff6
  1. 4
      src/vrend_decode.c

@ -1045,6 +1045,10 @@ void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen,
if (handle >= VREND_MAX_CTX)
return;
dctx = dec_ctx[handle];
if (dctx)
return;
dctx = malloc(sizeof(struct vrend_decode_ctx));
if (!dctx)
return;

Loading…
Cancel
Save