From 047e3264f67bc54365be7b0e163b6910a9e9de3a Mon Sep 17 00:00:00 2001 From: Iurie Salomov Date: Tue, 12 Apr 2016 23:24:30 +0100 Subject: va: check null context in vlVaDestroyContext Signed-off-by: Iurie Salomov Reviewed-by: Julien Isorce --- src/gallium/state_trackers/va/context.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/state_trackers/va/context.c') diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index b25c381d968..25d587af46f 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -283,6 +283,10 @@ vlVaDestroyContext(VADriverContextP ctx, VAContextID context_id) drv = VL_VA_DRIVER(ctx); pipe_mutex_lock(drv->mutex); context = handle_table_get(drv->htab, context_id); + if (!context) { + pipe_mutex_unlock(drv->mutex); + return VA_STATUS_ERROR_INVALID_CONTEXT; + } if (context->decoder) { if (u_reduce_video_profile(context->decoder->profile) == -- cgit v1.2.3