mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
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:
parent
69db546936
commit
d3dc812eb1
1 changed files with 6 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue