Module: sems
Branch: master
Commit: 08b49fdf32fcd73a27682993a6340fa22df72141
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=08b49fdf32fcd73a27682993a6340fa22df72141

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Feb 24 15:11:48 2011 +0100

fix ilbc mode if fmtp format error

---

 core/plug-in/ilbc/ilbc.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/core/plug-in/ilbc/ilbc.c b/core/plug-in/ilbc/ilbc.c
index d796118..79594c1 100644
--- a/core/plug-in/ilbc/ilbc.c
+++ b/core/plug-in/ilbc/ilbc.c
@@ -140,15 +140,18 @@ long iLBC_create(const char* format_parameters, 
amci_codec_fmt_info_t* format_de
     while (*msep!='=' && *msep!='\0') msep++;
     msep++; mbegin=msep;
     while (*msep!='=' && *msep!='\0') msep++;
-    if ((msep-mbegin)>8) { DBG("Error in fmtp line >>'%s<<.\n", 
format_parameters); mode=30; }
-    memcpy(modeb, mbegin, msep-mbegin);
-    modeb[msep-mbegin]='\0';
-    if ((!(mode=atoi(modeb))) || (mode != 30 && mode!= 20)) { 
+    if ((msep-mbegin)>8) {
       DBG("Error in fmtp line >>'%s<<.\n", format_parameters); 
-      mode=30; 
+      mode=30;
+    } else {
+      memcpy(modeb, mbegin, msep-mbegin);
+      modeb[msep-mbegin]='\0';
+      if ((!(mode=atoi(modeb))) || (mode != 30 && mode!= 20)) {
+       DBG("Error in fmtp line >>'%s<<.\n", format_parameters);
+       mode=30;
+      }
     }
   }
-
   format_description[0].id = AMCI_FMT_FRAME_LENGTH ;
   format_description[0].value = mode;
   format_description[1].id = AMCI_FMT_FRAME_SIZE;

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to