[Spice-devel] [RFCv5 40/47] server/red_worker: red_current_add_equal: add dcc null checks
Alon Levy
alevy at redhat.com
Sun May 8 06:11:36 PDT 2011
check for dcc!=NULL before adding to pipe in several places.
---
server/red_worker.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/server/red_worker.c b/server/red_worker.c
index d911613..9a7fca9 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2943,10 +2943,12 @@ static inline int red_current_add_equal(RedRender *render, DrawItem *item, TreeI
int add_after = !!other_drawable->stream && is_drawable_independent_from_surfaces(drawable);
red_stream_maintenance(render, drawable, other_drawable);
__current_add_drawable(render, drawable, &other->siblings_link);
- if (add_after) {
- red_pipe_add_drawable_after(dcc, drawable, other_drawable);
- } else {
- red_pipe_add_drawable(dcc, drawable);
+ if (dcc) {
+ if (add_after) {
+ red_pipe_add_drawable_after(dcc, drawable, other_drawable);
+ } else {
+ red_pipe_add_drawable(dcc, drawable);
+ }
}
remove_drawable(render, other_drawable);
return TRUE;
@@ -2955,7 +2957,7 @@ static inline int red_current_add_equal(RedRender *render, DrawItem *item, TreeI
switch (item->effect) {
case QXL_EFFECT_REVERT_ON_DUP:
if (is_same_drawable(worker, drawable, other_drawable)) {
- if (!ring_item_is_linked(&other_drawable->pipe_item.link)) {
+ if (!ring_item_is_linked(&other_drawable->pipe_item.link) && dcc) {
red_pipe_add_drawable(dcc, drawable);
}
remove_drawable(render, other_drawable);
@@ -2966,7 +2968,9 @@ static inline int red_current_add_equal(RedRender *render, DrawItem *item, TreeI
if (is_same_geometry(worker, drawable, other_drawable)) {
__current_add_drawable(render, drawable, &other->siblings_link);
remove_drawable(render, other_drawable);
- red_pipe_add_drawable(dcc, drawable);
+ if (dcc) {
+ red_pipe_add_drawable(dcc, drawable);
+ }
return TRUE;
}
break;
--
1.7.5.1
More information about the Spice-devel
mailing list