frontends/va/config: Fix check for packed header config

Fixes: b4651890be ("frontends/va: Update conditional checks for code stability.")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4285
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9020>
This commit is contained in:
Thong Thai 2021-02-12 13:42:42 -05:00 committed by Marge Bot
parent 74f9bcc21c
commit 38f012e023

View file

@ -319,7 +319,8 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
}
}
if (attrib_list[i].type == VAConfigAttribEncPackedHeaders) {
if (attrib_list[i].value != 0) {
if (attrib_list[i].value > 1 ||
config->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE) {
FREE(config);
return VA_STATUS_ERROR_INVALID_VALUE;
}