[gtk-engines/gtk-engines-2-18] Fix a potential endless loop in draw_progressbar_fill



commit 72fa65bf3b1a8707dd80d9c543087e2d383a5a07
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Sat Oct 31 18:41:57 2009 +0100

    Fix a potential endless loop in draw_progressbar_fill

 engines/clearlooks/src/clearlooks_draw.c          |    2 +-
 engines/clearlooks/src/clearlooks_draw_glossy.c   |    2 +-
 engines/clearlooks/src/clearlooks_draw_gummy.c    |    2 +-
 engines/clearlooks/src/clearlooks_draw_inverted.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_draw.c b/engines/clearlooks/src/clearlooks_draw.c
index 94c194f..17c1a2d 100644
--- a/engines/clearlooks/src/clearlooks_draw.c
+++ b/engines/clearlooks/src/clearlooks_draw.c
@@ -920,7 +920,7 @@ clearlooks_draw_progressbar_fill (cairo_t *cr,
 	cairo_paint (cr);
 
 	/* Draw the Strokes */
-	while (tile_pos <= width+x_step)
+	while (stroke_width > 0 && tile_pos <= width+x_step)
 	{
 		cairo_move_to (cr, stroke_width/2-x_step, 0);
 		cairo_line_to (cr, stroke_width-x_step,   0);
diff --git a/engines/clearlooks/src/clearlooks_draw_glossy.c b/engines/clearlooks/src/clearlooks_draw_glossy.c
index cf4ac9a..5c4bc64 100644
--- a/engines/clearlooks/src/clearlooks_draw_glossy.c
+++ b/engines/clearlooks/src/clearlooks_draw_glossy.c
@@ -486,7 +486,7 @@ clearlooks_glossy_draw_progressbar_fill (cairo_t *cr,
 	cairo_pattern_destroy (pattern);
 
 	/* Draw the Strokes */
-	while (tile_pos <= width+x_step)
+	while (stroke_width > 0 && tile_pos <= width+x_step)
 	{
 		cairo_move_to (cr, stroke_width/2-x_step, 0);
 		cairo_line_to (cr, stroke_width-x_step,   0);
diff --git a/engines/clearlooks/src/clearlooks_draw_gummy.c b/engines/clearlooks/src/clearlooks_draw_gummy.c
index cc22377..9efe90b 100644
--- a/engines/clearlooks/src/clearlooks_draw_gummy.c
+++ b/engines/clearlooks/src/clearlooks_draw_gummy.c
@@ -412,7 +412,7 @@ clearlooks_gummy_draw_progressbar_fill (cairo_t                     *cr,
 	cairo_pattern_destroy (pattern);
 
 	/* Draw the strokes */
-	while (tile_pos <= width+x_step)
+	while (stroke_width > 0 && tile_pos <= width+x_step)
 	{
 		cairo_move_to (cr, stroke_width/2-x_step, 0);
 		cairo_line_to (cr, stroke_width-x_step,   0);
diff --git a/engines/clearlooks/src/clearlooks_draw_inverted.c b/engines/clearlooks/src/clearlooks_draw_inverted.c
index a621e92..1bcf000 100644
--- a/engines/clearlooks/src/clearlooks_draw_inverted.c
+++ b/engines/clearlooks/src/clearlooks_draw_inverted.c
@@ -238,7 +238,7 @@ clearlooks_inverted_draw_progressbar_fill (cairo_t *cr,
 	cairo_pattern_destroy (pattern);
 
 	/* Draw the Strokes */
-	while (tile_pos <= width+x_step)
+	while (stroke_width > 0 && tile_pos <= width+x_step)
 	{
 		cairo_move_to (cr, stroke_width/2-x_step, 0);
 		cairo_line_to (cr, stroke_width-x_step,   0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]