summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2013-03-14 22:07:13 +0200
committerTanu Kaskinen <tanuk@iki.fi>2013-03-22 20:49:47 +0200
commitee0a5d50148ee1d99a511372ae2af2036b6612a2 (patch)
tree8af0239fc1bcb21ec174341404566213351ce20a
parentf8b57af2c890f3cb98ee07ed7c0192e75146cbf1 (diff)
filter-apply: Fix segfault with moving streams
process() may be called with a stream that doesn't have its sink/source set. This can happen if the proplist change callback is called when the stream is moving.
-rw-r--r--src/modules/module-filter-apply.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/module-filter-apply.c b/src/modules/module-filter-apply.c
index 6826a0a1..4e85ea15 100644
--- a/src/modules/module-filter-apply.c
+++ b/src/modules/module-filter-apply.c
@@ -417,14 +417,18 @@ static pa_hook_result_t process(struct userdata *u, pa_object *o, pa_bool_t is_s
pa_bool_t done_something = FALSE;
pa_sink *sink = NULL;
pa_source *source = NULL;
- pa_module *module;
+ pa_module *module = NULL;
if (is_sink_input) {
sink = PA_SINK_INPUT(o)->sink;
- module = sink->module;
+
+ if (sink)
+ module = sink->module;
} else {
source = PA_SOURCE_OUTPUT(o)->source;
- module = source->module;
+
+ if (source)
+ module = source->module;
}
/* If there is no sink/source yet, we can't do much */