[PATCH spice-gtk 1/2] spice-channel: Store the caps correctly

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

 



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 <victortoso@xxxxxxxxxx>
Signed-off-by: Pavel Grunt <pgrunt@xxxxxxxxxx>
---
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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]