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

Marc-André Lureau elmarco at kemper.freedesktop.org
Fri Mar 14 14:33:28 PDT 2014


 gtk/spice-uri.c    |    2 +-
 gtk/spice-widget.c |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 2cb753503a04fdb79ba353e2a5692258132cc99c
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Mar 13 14:21:59 2014 +0100

    Fix spice_display_get_pixbuf() with offset area
    
    Fix screenshot of secondary displays, with an area position != (0,0).
    
    This has never been working correctly since the surface display "area"
    was introducted in:
    
    commit e3bb7b1cfd162fcb8943e9d582dab43eeec6ce41
    Author: Marc-André Lureau <marcandre.lureau at redhat.com>
    Date:   Tue Jun 12 19:24:47 2012 +0200
    
        display: learn to restrict display to an area
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1029761

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 504a0b5..0e4a0de 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -2583,8 +2583,9 @@ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay *display)
     src = d->data;
     dest = data;
 
-    for (y = d->area.y; y < d->area.height; ++y) {
-        for (x = d->area.x; x < d->area.width; ++x) {
+    src += d->area.y * d->stride + d->area.x * 4;
+    for (y = 0; y < d->area.height; ++y) {
+        for (x = 0; x < d->area.width; ++x) {
           dest[0] = src[x * 4 + 2];
           dest[1] = src[x * 4 + 1];
           dest[2] = src[x * 4 + 0];
commit 524ee218ccd11bbb81e38dbc1b1bc35a0a58c9c0
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Mar 11 14:52:36 2014 +0100

    Silence some gcc warnings
    
    cc1: warnings being treated as errors
    spice-uri.c: In function ‘spice_uri_parse’:
    spice-uri.c:105: error: ‘saveptr’ may be used uninitialized in this
    function [-Wuninitialized]
    spice-uri.c:105: error: ‘saveptr2’ may be used uninitialized in this
    function [-Wuninitialized]

diff --git a/gtk/spice-uri.c b/gtk/spice-uri.c
index c379075..cf6e71b 100644
--- a/gtk/spice-uri.c
+++ b/gtk/spice-uri.c
@@ -103,7 +103,7 @@ gboolean spice_uri_parse(SpiceURI *self, const gchar *_uri, GError **error)
 
     /* yes, that parser is bad, we need GUri... */
     if (strstr(uri, "@")) {
-        gchar *saveptr, *saveptr2;
+        gchar *saveptr = NULL, *saveptr2 = NULL;
         gchar *next = strstr(uri, "@") + 1;
         gchar *auth = strtok_r(uri, "@", &saveptr);
         const gchar *user = strtok_r(auth, ":", &saveptr2);


More information about the Spice-commits mailing list