Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-01-24 03:38:51 +0300
committerHans Goudey <h.goudey@me.com>2021-01-24 03:38:51 +0300
commitbd4ed5ca9ae2a7b0f6a00cc0c985404ab13cc5d6 (patch)
treee3de58dd694ad67ceb14ade01c514d009564f9d7 /source/blender/editors/space_view3d
parentded9484925edd768cb80e1ca1c32c964fd941800 (diff)
Fix "use after scope" reported by ASAN
The float array is declared inside a smaller scope, pointed to, and then used later. This simply moves the declaration outside of the if statement. Also remove two redundant lines.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 4d0f0586696..59cafd9367f 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -226,17 +226,15 @@ static void gizmo_axis_draw(const bContext *C, wmGizmo *gz)
if (!is_aligned_back) {
float *inner_color = fading_color;
float *outline_color = fading_color;
+ float negative_color[4];
if (!is_pos) {
- float negative_color[4];
if (is_aligned_front) {
- inner_color = fading_color;
interp_v4_v4v4(
negative_color, (float[4]){1.0f, 1.0f, 1.0f, 1.0f}, axis_color[axis], 0.5f);
negative_color[3] = MIN2(depth + 1, 1.0f);
outline_color = negative_color;
}
else {
- outline_color = fading_color;
interp_v4_v4v4(negative_color, view_color, axis_color[axis], 0.25f);
negative_color[3] = MIN2(depth + 1, 1.0f);
inner_color = negative_color;