diff options
author | Vinson Lee <vlee@freedesktop.org> | 2020-10-28 19:47:42 -0700 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-11-17 10:57:32 -0800 |
commit | 5953d04aec1704fd28cb006282685cc8d34ddecc (patch) | |
tree | 86ecda80c09c09c029c1b279d16986a25d59d84d | |
parent | 94f202c6bc5371ccdc21b96dc5a2afb076fd64a6 (diff) |
frontends/va: Fix *num_entrypoints check.
Fix defect reported by Coverity Scan.
Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking num_entrypoints suggests that it
may be null, but it has already been dereferenced on all paths
leading to the check.
Fixes: 5bcaa1b9e970 ("st/va: add encode entrypoint v2")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7360>
(cherry picked from commit 7820c8c13ff3e9367b208f09059c940a1629f708)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/frontends/va/config.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index bb87d245f4b..883867fb9e7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -481,7 +481,7 @@ "description": "frontends/va: Fix *num_entrypoints check.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "5bcaa1b9e9707aea7be73b406345bb9e46f92a18" }, diff --git a/src/gallium/frontends/va/config.c b/src/gallium/frontends/va/config.c index fe96be0b38a..66ed913e7e0 100644 --- a/src/gallium/frontends/va/config.c +++ b/src/gallium/frontends/va/config.c @@ -99,7 +99,7 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile, PIPE_VIDEO_CAP_SUPPORTED)) entrypoint_list[(*num_entrypoints)++] = VAEntrypointEncSlice; - if (num_entrypoints == 0) + if (*num_entrypoints == 0) return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; assert(*num_entrypoints <= ctx->max_entrypoints); |