diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-06-19 17:26:32 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-07-16 17:46:41 +0200 |
commit | 8ee26756499604c329af98cf8c19daff3d1caa7d (patch) | |
tree | 94b5c42231ab2264dcb4fae836d0bc512848dd7c /gtk/spice-widget.c | |
parent | b79f3e148b5c9952a63de80c0a6959dc129c9cc0 (diff) |
Don't attempt to draw an invalid area
If we don't intersect, the area is invalid or of size 0.
Diffstat (limited to 'gtk/spice-widget.c')
-rw-r--r-- | gtk/spice-widget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 6635e31..d33e79e 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -878,7 +878,8 @@ static gboolean draw_event(GtkWidget *widget, cairo_t *cr) SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); g_return_val_if_fail(d != NULL, false); - if (d->mark == 0 || d->data == NULL) + if (d->mark == 0 || d->data == NULL || + d->area.width == 0 || d->area.height == 0) return false; g_return_val_if_fail(d->ximage != NULL, false); @@ -894,7 +895,8 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *expose) SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display); g_return_val_if_fail(d != NULL, false); - if (d->mark == 0 || d->data == NULL) + if (d->mark == 0 || d->data == NULL || + d->area.width == 0 || d->area.height == 0) return false; g_return_val_if_fail(d->ximage != NULL, false); |