From 893808006a6f48c1efd8e8101a58ab2dac8dc370 Mon Sep 17 00:00:00 2001 From: Drew Davenport Date: Tue, 24 Apr 2018 17:01:32 -0600 Subject: [PATCH] st/va: Fix potential buffer overread VASurfaceAttribExternalBuffers.pitches is indexed by plane. Current implementation only supports single plane layout. Reviewed-by: Kristian H. Kristensen Reviewed-by: Leo Liu --- src/gallium/state_trackers/va/surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c index 86041369444..6fe21b89e58 100644 --- a/src/gallium/state_trackers/va/surface.c +++ b/src/gallium/state_trackers/va/surface.c @@ -574,7 +574,7 @@ suface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface, memset(&whandle, 0, sizeof(struct winsys_handle)); whandle.type = DRM_API_HANDLE_TYPE_FD; whandle.handle = memory_attibute->buffers[index]; - whandle.stride = memory_attibute->pitches[index]; + whandle.stride = memory_attibute->pitches[0]; resource = pscreen->resource_from_handle(pscreen, &res_templ, &whandle, PIPE_HANDLE_USAGE_READ_WRITE); -- 2.30.2