From 6cef49df2b77e9384202683b7583f1c8dc449223 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 16 May 2008 14:43:21 +0000 Subject: [PATCH] tweak asserts. Found by Klockwork (www.klocwork.com) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8432 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_io.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/switch_core_io.c b/src/switch_core_io.c index c754cd444e..30c46908ed 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -61,6 +61,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core switch_status_t status = SWITCH_STATUS_FALSE; switch_io_event_hook_video_read_frame_t *ptr; + switch_assert(session != NULL); + if (switch_channel_get_state(session->channel) >= CS_HANGUP) { return SWITCH_STATUS_FALSE; } @@ -84,7 +86,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core goto done; } - switch_assert(session != NULL); switch_assert(*frame != NULL); if (switch_test_flag(*frame, SFF_CNG)) { @@ -104,7 +105,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi int need_codec, perfect, do_bugs = 0, do_resample = 0, is_cng = 0; unsigned int flag = 0; - top: + switch_assert(session != NULL); + +top: if (switch_channel_get_state(session->channel) >= CS_HANGUP) { *frame = NULL; @@ -115,7 +118,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi status = SWITCH_STATUS_FALSE; need_codec = perfect = 0; - switch_assert(session != NULL); *frame = NULL; if (switch_channel_test_flag(session->channel, CF_HOLD)) { @@ -142,7 +144,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi goto done; } - switch_assert(session != NULL); switch_assert(*frame != NULL); if (switch_test_flag(*frame, SFF_PROXY_PACKET)) {