From 989b6f0e4b423426c558b7f55339b62a7e39ba00 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 10 Jun 2012 11:46:36 -0700 Subject: [PATCH] Timeline: Avoid uninitialized read when drawing waveforms. --- timeline/src/Waveform.C | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/timeline/src/Waveform.C b/timeline/src/Waveform.C index 92fc80b..04c5165 100644 --- a/timeline/src/Waveform.C +++ b/timeline/src/Waveform.C @@ -99,17 +99,17 @@ Waveform::draw ( int X, int Y, int W, int H, fl_color( color ); fl_begin_complex_polygon(); - + j = start; - - for ( int x = X; x < X + W; x++, j += skip ) + + for ( int x = X; x <= X + W; x++, j += skip ) fl_vertex( x, ty - ( halfheight * pbuf[ j ].min ) ); - - // j = start + ( W * skip ); - + + j -= skip; + for ( int x = X + W; x >= X; x--, j -= skip ) fl_vertex( x, ty - ( halfheight * pbuf[ j ].max ) ); - + fl_end_complex_polygon(); } }