linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] [PATCH mediastreamer2] Do not destroy uninitialize


From: Thierry Reding
Subject: [Linphone-developers] [PATCH mediastreamer2] Do not destroy uninitialized echo canceller
Date: Thu, 23 Feb 2012 08:17:47 +0100

Under certain circumstances it can happen that the echo canceller is not
initialized before it is destroyed. The ms_filter_destroy() function
does not check for a NULL pointer before dereferencing so we must make
sure that the caller does not pass one in.

Signed-off-by: Thierry Reding <address@hidden>
---
 src/audiostream.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/audiostream.c b/src/audiostream.c
index 2274f0d..9ac83d0 100644
--- a/src/audiostream.c
+++ b/src/audiostream.c
@@ -389,7 +389,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile 
*profile, const char
        ms_filter_call_method(stream->soundwrite,MS_FILTER_SET_NCHANNELS, &tmp);
 
        /*configure the echo canceller if required */
-       if (!use_ec) {
+       if (!use_ec && stream->ec != NULL) {
                ms_filter_destroy(stream->ec);
                stream->ec=NULL;
        }
-- 
1.7.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]