From d9248560e471a6ef002ea87a8213ed510ad7805c Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 23 Aug 2019 14:14:39 +1000 Subject: [PATCH] vulkancolorconvert: explicitly initalize swizzle arrays Fixes uninitialized access of the indexed values larger than the number of planes in the video format. --- ext/vulkan/vkcolorconvert.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/vulkan/vkcolorconvert.c b/ext/vulkan/vkcolorconvert.c index 8cb1234797..c954863cd7 100644 --- a/ext/vulkan/vkcolorconvert.c +++ b/ext/vulkan/vkcolorconvert.c @@ -657,11 +657,11 @@ calculate_reorder_indexes (GstVideoFormat in_format, const GstVideoFormatInfo *in_finfo, *out_finfo; VkFormat in_vk_formats[GST_VIDEO_MAX_COMPONENTS]; VkFormat out_vk_formats[GST_VIDEO_MAX_COMPONENTS]; - int in_vk_order[GST_VIDEO_MAX_COMPONENTS], - in_reorder[GST_VIDEO_MAX_COMPONENTS]; - int out_vk_order[GST_VIDEO_MAX_COMPONENTS], - out_reorder[GST_VIDEO_MAX_COMPONENTS]; - int tmp[GST_VIDEO_MAX_PLANES]; + int in_vk_order[GST_VIDEO_MAX_COMPONENTS] = { 0, }; + int in_reorder[GST_VIDEO_MAX_COMPONENTS] = { 0, }; + int out_vk_order[GST_VIDEO_MAX_COMPONENTS] = { 0, }; + int out_reorder[GST_VIDEO_MAX_COMPONENTS] = { 0, }; + int tmp[GST_VIDEO_MAX_PLANES] = { 0, }; int i; in_finfo = gst_video_format_get_info (in_format);