frontends/va: fix coredump as creating surface with VAConfigAttrib

As creating surface with VAConfigAttrib, checking if modifier from attrib list is null

Signed-off-by: shanshengwang <shansheng.wang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15483>
This commit is contained in:
shansheng.wang
2022-03-21 12:08:56 +08:00
committed by Marge Bot
parent f9390dac23
commit 1bd8ef0c89

View File

@@ -902,8 +902,10 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format,
if (attrib_list[i].value.type != VAGenericValueTypePointer)
return VA_STATUS_ERROR_INVALID_PARAMETER;
modifier_list = attrib_list[i].value.value.p;
modifiers = modifier_list->modifiers;
modifiers_count = modifier_list->num_modifiers;
if (modifier_list != NULL) {
modifiers = modifier_list->modifiers;
modifiers_count = modifier_list->num_modifiers;
}
break;
#endif
case VASurfaceAttribUsageHint: