Commit: 05f1451d724874e12b3f1373e83849dbb4960ef6
Author: Richard Antalik
Date:   Sun May 12 15:21:38 2019 -0700
Branches: master
https://developer.blender.org/rB05f1451d724874e12b3f1373e83849dbb4960ef6

Fix T64371

Variable stripe_offs used without been initialized

Reviewed by: brecht

Differential Revision: https://developer.blender.org/D4845

===================================================================

M       source/blender/editors/space_sequencer/sequencer_draw.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c 
b/source/blender/editors/space_sequencer/sequencer_draw.c
index 7caad1d057e..60bc320c026 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1922,10 +1922,14 @@ static void draw_cache_view(const bContext *C)
   uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 
2, GPU_FETCH_FLOAT);
   immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 
-  float stripe_bot, stripe_top, stripe_offs;
+  float stripe_bot, stripe_top;
+  float stripe_offs = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin;
   float stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * 
U.pixelsize) -
                     v2d->cur.ymin;
 
+  CLAMP_MAX(stripe_ht, 0.2f);
+  CLAMP_MIN(stripe_offs, stripe_ht / 2);
+
   if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) {
     stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HEIGHT_HANDLES);
     stripe_top = stripe_bot + stripe_ht;
@@ -1944,10 +1948,6 @@ static void draw_cache_view(const bContext *C)
       continue;
     }
 
-    CLAMP_MAX(stripe_ht, 0.2f);
-    stripe_offs = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin;
-    CLAMP_MIN(stripe_offs, stripe_ht / 2);
-
     stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + stripe_offs;
     stripe_top = stripe_bot + stripe_ht;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to