Mesa (master): frontends/va/config: Fix check for packed header config

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 16 15:38:23 UTC 2021


Module: Mesa
Branch: master
Commit: 38f012e0238f145f4c83bf7abf59afceee333397
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=38f012e0238f145f4c83bf7abf59afceee333397

Author: Thong Thai <thong.thai at amd.com>
Date:   Fri Feb 12 13:42:42 2021 -0500

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

Fixes: b4651890be4 ("frontends/va: Update conditional checks for code stability.")
Signed-off-by: Thong Thai <thong.thai at amd.com>
Tested-by: James Zhu <James.Zhu at amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4285
Reviewed-by: Leo Liu <leo.liu at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9020>

---

 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;
          }



More information about the mesa-commit mailing list