frontends/va: Fix dereference before NULL check in postproc

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41024>
This commit is contained in:
David Rosca 2026-04-17 13:35:59 +02:00 committed by Marge Bot
parent 69db546936
commit d3dc812eb1

View file

@ -165,7 +165,7 @@ VAStatus
vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context_id,
VAProcFilterType *filters, unsigned int *num_filters)
{
vlVaDriver *drv = VL_VA_DRIVER(ctx);
vlVaDriver *drv;
vlVaContext *context;
unsigned int num = 0;
@ -175,6 +175,8 @@ vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context_id,
if (!num_filters || !filters)
return VA_STATUS_ERROR_INVALID_PARAMETER;
drv = VL_VA_DRIVER(ctx);
mtx_lock(&drv->mutex);
context = handle_table_get(drv->htab, context_id);
if (!context) {
@ -198,7 +200,7 @@ vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context_id,
VAProcFilterType type, void *filter_caps,
unsigned int *num_filter_caps)
{
vlVaDriver *drv = VL_VA_DRIVER(ctx);
vlVaDriver *drv;
vlVaContext *context;
unsigned int i;
bool supports_filters;
@ -209,6 +211,8 @@ vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context_id,
if (!filter_caps || !num_filter_caps)
return VA_STATUS_ERROR_INVALID_PARAMETER;
drv = VL_VA_DRIVER(ctx);
mtx_lock(&drv->mutex);
context = handle_table_get(drv->htab, context_id);
if (!context) {