summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-28 07:51:35 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-05-28 07:59:49 +0530
commitb0f5b8d2fab347a062fa6ed34ff2908a1c29a41d (patch)
treefdaede72c6cd442776c65cf313ed3d4443cae9d4
parent9e78de2da27e882b8cd956ec859304629011a55b (diff)
echo-cancel: Fix a crash is speex cleanup
If module initialisation fails, the speex done() function might try to free a value that's not been allocated yet. Adding protection for this condition.
-rw-r--r--src/modules/echo-cancel/speex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c
index ce361fc3..72c52680 100644
--- a/src/modules/echo-cancel/speex.c
+++ b/src/modules/echo-cancel/speex.c
@@ -109,6 +109,7 @@ void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *p
}
void pa_speex_ec_done(pa_echo_canceller *ec) {
- speex_echo_state_destroy(ec->params.priv.speex.state);
+ if (ec->params.priv.speex.state)
+ speex_echo_state_destroy(ec->params.priv.speex.state);
ec->params.priv.speex.state = NULL;
}