va: check null context in vlVaDestroyContext
authorIurie Salomov <iurcic@gmail.com>
Tue, 12 Apr 2016 22:24:30 +0000 (23:24 +0100)
committerJulien Isorce <j.isorce@samsung.com>
Tue, 12 Apr 2016 23:52:53 +0000 (00:52 +0100)
Signed-off-by: Iurie Salomov <iurcic@gmail.com>
Reviewed-by: Julien Isorce <j.isorce@samsung.com>
src/gallium/state_trackers/va/context.c

index b25c381d96807a49f4135048e59d1dbffff9fd52..25d587af46fa9fe48cf887d7837e893cb65fb595 100644 (file)
@@ -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) ==