[Freeswitch-svn] [commit] r8432 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri May 16 10:43:21 EDT 2008


Author: mikej
Date: Fri May 16 10:43:21 2008
New Revision: 8432

Modified:
   freeswitch/trunk/src/switch_core_io.c

Log:
tweak asserts. Found by Klockwork (www.klocwork.com)

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Fri May 16 10:43:21 2008
@@ -61,6 +61,8 @@
 	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 @@
 		goto done;
 	}
 
-	switch_assert(session != NULL);
 	switch_assert(*frame != NULL);
 
 	if (switch_test_flag(*frame, SFF_CNG)) {
@@ -104,7 +105,9 @@
 	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 @@
 	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 @@
 		goto done;
 	}
 
-	switch_assert(session != NULL);
 	switch_assert(*frame != NULL);
 
 	if (switch_test_flag(*frame, SFF_PROXY_PACKET)) {



More information about the Freeswitch-svn mailing list