From 38f012e0238f145f4c83bf7abf59afceee333397 Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Fri, 12 Feb 2021 13:42:42 -0500 Subject: [PATCH] frontends/va/config: Fix check for packed header config Fixes: b4651890be4 ("frontends/va: Update conditional checks for code stability.") Signed-off-by: Thong Thai Tested-by: James Zhu Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4285 Reviewed-by: Leo Liu Part-of: --- src/gallium/frontends/va/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/va/config.c b/src/gallium/frontends/va/config.c index e7172a3c7a5..e658867f6e0 100644 --- a/src/gallium/frontends/va/config.c +++ b/src/gallium/frontends/va/config.c @@ -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; }