diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c index dfd05b64..2d6696ec 100644 --- a/src/modules/echo-cancel/module-echo-cancel.c +++ b/src/modules/echo-cancel/module-echo-cancel.c @@ -407,7 +407,8 @@ static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t * make sure we don't access it in that time. Also, the * source output is first shut down, the source second. */ if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state) || - !PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->thread_info.state)) { + !PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->thread_info.state) || + !u->source_output->source) { *((pa_usec_t*) data) = 0; return 0; } @@ -443,7 +444,8 @@ static int sink_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t of * make sure we don't access it in that time. Also, the * sink input is first shut down, the sink second. */ if (!PA_SINK_IS_LINKED(u->sink->thread_info.state) || - !PA_SINK_INPUT_IS_LINKED(u->sink_input->thread_info.state)) { + !PA_SINK_INPUT_IS_LINKED(u->sink_input->thread_info.state) || + !u->sink_input->sink) { *((pa_usec_t*) data) = 0; return 0; }