[Spice-devel] [PATCH 14/15] dc: inline dpi computation
Frediano Ziglio
fziglio at redhat.com
Mon May 16 16:40:39 UTC 2016
Actually not exactly the same as this fix a bug if base is not the
first element (in this case if dpi_ring_item is NULL dpi is not)
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/display-channel.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/server/display-channel.c b/server/display-channel.c
index 906882d..608d176 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -497,7 +497,6 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
if (is_same_drawable(drawable, other_drawable)) {
DisplayChannelClient *dcc;
- RedDrawablePipeItem *dpi;
RingItem *worker_ring_item, *dpi_ring_item;
other_drawable->refs++;
@@ -511,8 +510,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
while (worker_ring_item) {
dcc = SPICE_CONTAINEROF(worker_ring_item, DisplayChannelClient,
common.base.channel_link);
- dpi = SPICE_CONTAINEROF(dpi_ring_item, RedDrawablePipeItem, base);
- if (dpi && dcc == dpi->dcc) {
+ if (dpi_ring_item && dcc == SPICE_CONTAINEROF(dpi_ring_item, RedDrawablePipeItem, base)->dcc) {
dpi_ring_item = ring_next(&other_drawable->pipes, dpi_ring_item);
} else {
dcc_prepend_drawable(dcc, drawable);
--
2.7.4
More information about the Spice-devel
mailing list