From 1d4cbcdf285730d8e692e10c44cb5dc7e683efc1 Mon Sep 17 00:00:00 2001 From: Chandu Babu N Date: Sat, 17 Jun 2017 11:49:13 +0000 Subject: [PATCH] change va max_entrypoints MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As encode support is added along with decode, increase max_entrypoints to two. vaMaxNumEntrypoints was returning incorrect value and causing memory corruption before this commit v2: assert when max_entrypoints needs to be bigger CC: mesa-stable@lists.freedesktop.org Reviewed-by: Christian König --- src/gallium/state_trackers/va/config.c | 2 ++ src/gallium/state_trackers/va/context.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c index c5d69bdc974..7d3bd648d97 100644 --- a/src/gallium/state_trackers/va/config.c +++ b/src/gallium/state_trackers/va/config.c @@ -102,6 +102,8 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile, if (num_entrypoints == 0) return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; + assert(*num_entrypoints <= ctx->max_entrypoints); + return VA_STATUS_SUCCESS; } diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c index 6e7a58da687..186f5066bd0 100644 --- a/src/gallium/state_trackers/va/context.c +++ b/src/gallium/state_trackers/va/context.c @@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx) *ctx->vtable = vtable; *ctx->vtable_vpp = vtable_vpp; ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - PIPE_VIDEO_PROFILE_UNKNOWN; - ctx->max_entrypoints = 1; + ctx->max_entrypoints = 2; ctx->max_attributes = 1; ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS; ctx->max_subpic_formats = 1; -- 2.30.2