From 92b4e74985965e1300566c63d66c71e5d7bb7167 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 May 2023 09:15:47 +1000 Subject: [PATCH] Fix out-of-bounds read drawing bundles with custom-colors --- source/blender/draw/engines/overlay/overlay_extra.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index bc0b19f3aaa..ba17c7aabd6 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -884,7 +884,7 @@ static void camera_view3d_reconstruction( /* Index must start in 1, to mimic BKE_tracking_track_get_for_selection_index. */ int track_index = 1; - float bundle_color_custom[3]; + float bundle_color_custom[4]; float *bundle_color_solid = G_draw.block.color_bundle_solid; float *bundle_color_unselected = G_draw.block.color_wire; uchar text_color_selected[4], text_color_unselected[4]; @@ -930,6 +930,8 @@ static void camera_view3d_reconstruction( /* Meh, hardcoded srgb transform here. */ /* TODO: change the actual DNA color to be linear. */ srgb_to_linearrgb_v3_v3(bundle_color_custom, track->color); + bundle_color_custom[3] = 1.0; + bundle_color = bundle_color_custom; } else if (is_solid_bundle) {