[Spice-devel] [PATCH] fixup! Change Drawable->pipes from Ring to GList

Jonathon Jongsma jjongsma at redhat.com
Fri Sep 16 16:04:19 UTC 2016


Fix potential infinite loop
---
You can still introduce a foreach macro if you'd like, but this should fix the
infinite loop for now.

 server/stream.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/stream.c b/server/stream.c
index 934b236..be3e437 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -331,7 +331,6 @@ void detach_stream(DisplayChannel *display, Stream *stream)
 static void before_reattach_stream(DisplayChannel *display,
                                    Stream *stream, Drawable *new_frame)
 {
-    RedDrawablePipeItem *dpi;
     DisplayChannelClient *dcc;
     int index;
     StreamAgent *agent;
@@ -352,8 +351,8 @@ static void before_reattach_stream(DisplayChannel *display,
     index = display_channel_get_stream_id(display, stream);
     dpi_item = stream->current->pipes;
     while (dpi_item) {
-        GList *dpi_next = dpi_item->next;
-        dpi = dpi_item->data;
+        RedDrawablePipeItem *dpi = dpi_item->data;
+        dpi_item = dpi_item->next;
         dcc = dpi->dcc;
         agent = dcc_get_stream_agent(dcc, index);
 
@@ -373,7 +372,6 @@ static void before_reattach_stream(DisplayChannel *display,
                 ++agent->drops;
             }
         }
-        dpi_item = dpi_next;
     }
 
 
-- 
2.7.4



More information about the Spice-devel mailing list