From d37fdc0dd69a4fe304078fa774f0cf4b70bcae9c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 6 Aug 2008 23:25:24 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9231 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 6dc6e90f55..11db95e45d 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -626,8 +626,12 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f if (tech_pvt->read_frame.datalen > 0) { size_t bytes = 0; int frames = 1; - + if (!switch_test_flag((&tech_pvt->read_frame), SFF_CNG)) { + if (!tech_pvt->read_codec.implementation) { + *frame = NULL; + return SWITCH_STATUS_GENERR; + } if ((bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame)) { frames = (tech_pvt->read_frame.datalen / bytes); }