[murrine] Fix a potential endless loop in draw_progressbar_fill and draw_menuitem. #600176



commit 7ab38241c382e3ed9db3f61b7250edb606fe3565
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Sun Nov 1 02:02:57 2009 +0100

    Fix a potential endless loop in draw_progressbar_fill and draw_menuitem. #600176

 src/murrine_draw.c      |    4 ++--
 src/murrine_draw_rgba.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 0b2daff..44c0540 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -657,7 +657,7 @@ murrine_draw_progressbar_fill (cairo_t *cr,
 		case 1:
 		{
 			/* Draw 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);
@@ -1407,7 +1407,7 @@ murrine_draw_menuitem (cairo_t *cr,
 
 			cairo_save (cr);
 			/* Draw 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/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
index 154c1ce..7d7ded9 100644
--- a/src/murrine_draw_rgba.c
+++ b/src/murrine_draw_rgba.c
@@ -542,7 +542,7 @@ murrine_rgba_draw_progressbar_fill (cairo_t *cr,
 			cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 
 			/* Draw 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]