diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-28 07:51:35 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-28 07:59:49 +0530 |
commit | b0f5b8d2fab347a062fa6ed34ff2908a1c29a41d (patch) | |
tree | fdaede72c6cd442776c65cf313ed3d4443cae9d4 /src | |
parent | 9e78de2da27e882b8cd956ec859304629011a55b (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.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/echo-cancel/speex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c index ce361fc33..72c52680a 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; } |