The commit babe5630d5d3242b1d186cccdd5b4d51debe78e9 forgot to update
position of the caps pointer making remote caps to not be stored.

That cause strange behavior in remote-viewer - it always opened window
for each remote display.

Signed-off-by: Victor Toso <victort...@redhat.com>
Signed-off-by: Pavel Grunt <pgr...@redhat.com>
---
the lines were reordered to make the two "blocks" look similar, making clear 
that is possible to factor out the common code.
---
 src/spice-channel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/spice-channel.c b/src/spice-channel.c
index 418e2b7..b8cf19c 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1938,8 +1938,9 @@ static gboolean spice_channel_recv_link_msg(SpiceChannel 
*channel)
         CHANNEL_DEBUG(channel, "got common caps %d:0x%X", i, *caps);
     }
 
-    g_array_set_size(c->remote_caps, num_channel_caps);
     caps_src += num_common_caps * sizeof(uint32_t);
+    g_array_set_size(c->remote_caps, num_channel_caps);
+    caps = &g_array_index(c->remote_caps, uint32_t, 0);
     memcpy(caps, caps_src, num_channel_caps * sizeof(uint32_t));
     for (i = 0; i < num_channel_caps; i++, caps++) {
         *caps = GUINT32_FROM_LE(*caps);
-- 
2.13.0

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to