From 9b0a0b67ce5624df6294877631eb531c76d8b422 Mon Sep 17 00:00:00 2001 From: smorlat Date: Thu, 11 Dec 2008 16:39:36 +0000 Subject: [PATCH] fix bug in msx264 fix segfault when sending a dtmf when call is not yet established. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@201 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/mediastreamer2/plugins/msx264/src/msx264.c | 2 +- linphone/mediastreamer2/src/audiostream.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/linphone/mediastreamer2/plugins/msx264/src/msx264.c b/linphone/mediastreamer2/plugins/msx264/src/msx264.c index 57318affb..19ce85a30 100644 --- a/linphone/mediastreamer2/plugins/msx264/src/msx264.c +++ b/linphone/mediastreamer2/plugins/msx264/src/msx264.c @@ -457,7 +457,7 @@ static int nalusToFrame(DecData *d, MSQueue *naluq, bool_t *new_sps_pps){ *dst++=1; *dst++=*src++; while(src<(im->b_wptr-3)){ - if (src[0]==0 && src[1]==0 && src[2]<=3){ + if (src[0]==0 && src[1]==0 && src[2]<3){ *dst++=0; *dst++=0; *dst++=3; diff --git a/linphone/mediastreamer2/src/audiostream.c b/linphone/mediastreamer2/src/audiostream.c index 7b0d6c5da..376e6c02c 100644 --- a/linphone/mediastreamer2/src/audiostream.c +++ b/linphone/mediastreamer2/src/audiostream.c @@ -440,7 +440,9 @@ void ring_stop(RingStream *stream){ int audio_stream_send_dtmf(AudioStream *stream, char dtmf) { - ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SEND_DTMF,&dtmf); - ms_filter_call_method(stream->dtmfgen,MS_DTMF_GEN_PUT,&dtmf); + if (stream->rtpsend) + ms_filter_call_method(stream->rtpsend,MS_RTP_SEND_SEND_DTMF,&dtmf); + if (stream->dtmfgen) + ms_filter_call_method(stream->dtmfgen,MS_DTMF_GEN_PUT,&dtmf); return 0; }