diff options
author | Li Qiang <liq3ea@gmail.com> | 2016-12-26 21:23:43 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-12-27 15:54:52 +1000 |
commit | 747a293ff6055203e529f083896b823e22523fe7 (patch) | |
tree | 947831ae48a6793a78ec6210f49c75f57d99e27c | |
parent | 40b0e7813325b08077b6f541b3989edb2d86d837 (diff) |
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>
-rw-r--r-- | src/vrend_decode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vrend_decode.c b/src/vrend_decode.c index 409cec7..ede7280 100644 --- a/src/vrend_decode.c +++ b/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; |