[Spice-commits] gtk/spice-widget.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Thu Nov 3 10:09:43 PDT 2011


 gtk/spice-widget.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit c56132f64f8337e23a61c9408b7df1c125c4fd40
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Nov 3 18:07:51 2011 +0100

    Return NULL if taking screenshot fails
    
    It can happen if the display is not yet ready.
    This change just removes a couple of warnings.

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 48e4e42..5ce1b00 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1703,6 +1703,10 @@ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display)
     data = g_malloc(d->width * d->height * 3);
     src = d->data;
     dest = data;
+
+    if (src == NULL || dest == NULL)
+        return NULL;
+
     for (y = 0; y < d->height; ++y) {
         for (x = 0; x < d->width; ++x) {
           dest[0] = src[x * 4 + 2];


More information about the Spice-commits mailing list