Fix out-of-bounds read drawing bundles with custom-colors

This commit is contained in:
Campbell Barton
2023-05-25 09:15:47 +10:00
parent 43a31d3c93
commit 92b4e74985

View File

@@ -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) {