]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4373 --resolve this is probably the same issue nobody would file a bug about on...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 23 Jul 2012 16:36:19 +0000 (11:36 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 23 Jul 2012 16:36:19 +0000 (11:36 -0500)
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/switch_core_port_allocator.c
src/switch_rtp.c

index ebf3deafc210c1433d3bc3a3f7c9eecfc0451e86..367d97b3bce69a526451ecf71f47e3bfa04f772c 100644 (file)
@@ -1682,7 +1682,7 @@ static void setup_codecs(struct private_object *tech_pvt)
        }
 
 
-       if (!payloads[1].id) {
+       if (!payloads[1].id && tech_pvt->transports[LDL_TPORT_VIDEO_RTP].local_port) {
                switch_rtp_release_port(tech_pvt->profile->ip, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].local_port);
                tech_pvt->transports[LDL_TPORT_VIDEO_RTP].local_port = 0;
        }
@@ -2846,7 +2846,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
                } else if (val && !strcasecmp(val, "md5")) {
                        profile->user_flags |= LDL_FLAG_SASL_MD5;
                }
-       } else if (!strcasecmp(var, "use-jingle") && !zstr(val)) {
+       } else if (!strcasecmp(var, "use-jingle") && switch_true(val)) {
                profile->user_flags |= LDL_FLAG_JINGLE;
        } else if (!strcasecmp(var, "exten") && !zstr(val)) {
                profile->exten = switch_core_strdup(module_pool, val);
index 4b15318274828f08e7c3842fcadc5e54bf4593b0..5863fddafe5e71b32d35411541cb0f86151ab194 100644 (file)
@@ -174,7 +174,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_free_port(switch_core
        switch_status_t status = SWITCH_STATUS_FALSE;
        int even = switch_test_flag(alloc, SPF_EVEN);
        int odd = switch_test_flag(alloc, SPF_ODD);
-       int index = port - alloc->start;
+       int index;
+
+       if (port < alloc->start) {
+               return SWITCH_STATUS_GENERR;
+       }
+
+       index = port - alloc->start;
 
        if (!(even && odd)) {
                index /= 2;
index 538a44fe16479d92f29f96c07dee559ab509c1cc..f0749d80873c7890ca7292896cfc990c56fc4080 100644 (file)
@@ -1229,7 +1229,7 @@ SWITCH_DECLARE(void) switch_rtp_release_port(const char *ip, switch_port_t port)
 {
        switch_core_port_allocator_t *alloc = NULL;
 
-       if (!ip) {
+       if (!ip || !port) {
                return;
        }