]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fail calls with uninitialized frame
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 4 Nov 2010 20:40:00 +0000 (15:40 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 4 Nov 2010 20:40:00 +0000 (15:40 -0500)
src/switch_core_io.c

index 2478df351f3d1cbd5f5470bc7ace5582407bf6e0..42f45859d1d0ca673285af50ee781af76583bb6d 100644 (file)
@@ -666,6 +666,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                return status;
        }
 
+       if (!(frame->codec && frame->codec->implementation)) {
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has received a bad frame with no codec!\n", 
+                                                 switch_channel_get_name(session->channel));
+               switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+               return SWITCH_STATUS_FALSE;
+       }
+
        switch_assert(frame->codec != NULL);
        switch_assert(frame->codec->implementation != NULL);