[Spice-devel] [RFC v4 59/62] server/red_worker: red_current_add_equal: add dcc null checks
Alon Levy
alevy at redhat.com
Tue Apr 26 03:55:24 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 3de664a..35e60d6 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2914,10 +2914,12 @@ static inline int red_current_add_equal(RedWorker *worker, Surfaces *surfaces,
int add_after = !!other_drawable->stream && is_drawable_independent_from_surfaces(drawable);
red_stream_maintenance(worker, surfaces, drawable, other_drawable);
__current_add_drawable(worker, surfaces, 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(worker, surfaces, other_drawable);
return TRUE;
@@ -2926,7 +2928,7 @@ static inline int red_current_add_equal(RedWorker *worker, Surfaces *surfaces,
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(worker, surfaces, other_drawable);
@@ -2937,7 +2939,9 @@ static inline int red_current_add_equal(RedWorker *worker, Surfaces *surfaces,
if (is_same_geometry(worker, drawable, other_drawable)) {
__current_add_drawable(worker, surfaces, drawable, &other->siblings_link);
remove_drawable(worker, surfaces, other_drawable);
- red_pipe_add_drawable(dcc, drawable);
+ if (dcc) {
+ red_pipe_add_drawable(dcc, drawable);
+ }
return TRUE;
}
break;
--
1.7.4.4
More information about the Spice-devel
mailing list