[gnome-color-manager] trivial: don't render broken profiles in the CIE widget



commit 4cf542b2e6d6c51dd0745a4921f1474e507aaa06
Author: Richard Hughes <richard hughsie com>
Date:   Wed Dec 2 20:50:38 2009 +0000

    trivial: don't render broken profiles in the CIE widget

 src/gcm-cie-widget.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-cie-widget.c b/src/gcm-cie-widget.c
index 193e72f..a993863 100644
--- a/src/gcm-cie-widget.c
+++ b/src/gcm-cie-widget.c
@@ -1004,17 +1004,23 @@ gcm_cie_widget_draw_gamut_outline (GcmCieWidget *cie, cairo_t *cr)
 	cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f);
 
 	gcm_cie_widget_offset_to_display (cie, priv->red_x, priv->red_y, &wx, &wy);
+	if (wx < 0 || wy < 0)
+		goto out;
 	cairo_move_to (cr, wx, wy);
 
 	gcm_cie_widget_offset_to_display (cie, priv->green_x, priv->green_y, &wx, &wy);
+	if (wx < 0 || wy < 0)
+		goto out;
 	cairo_line_to (cr, wx, wy);
 
 	gcm_cie_widget_offset_to_display (cie, priv->blue_x, priv->blue_y, &wx, &wy);
+	if (wx < 0 || wy < 0)
+		goto out;
 	cairo_line_to (cr, wx, wy);
 
 	cairo_close_path (cr);
 	cairo_stroke (cr);
-
+out:
 	cairo_restore (cr);
 }
 



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