Module: kamailio
Branch: master
Commit: 6a13f5f1103e02ec6abd5fc6b4f77ca9087ce43b
URL:
https://github.com/kamailio/kamailio/commit/6a13f5f1103e02ec6abd5fc6b4f77ca…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: Julien Chavanton <jchavanton(a)gmail.com>
Date: 2019-07-08T19:46:06Z
rtp_media_server: fix crash in sdp payload pasring
---
Modified: src/modules/rtp_media_server/rms_sdp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6a13f5f1103e02ec6abd5fc6b4f77ca…
Patch:
https://github.com/kamailio/kamailio/commit/6a13f5f1103e02ec6abd5fc6b4f77ca…
---
diff --git a/src/modules/rtp_media_server/rms_sdp.c
b/src/modules/rtp_media_server/rms_sdp.c
index b243d1ec45..c313d13646 100644
--- a/src/modules/rtp_media_server/rms_sdp.c
+++ b/src/modules/rtp_media_server/rms_sdp.c
@@ -240,9 +240,7 @@ PayloadType *rms_sdp_check_payload_type(PayloadType *pt,
rms_sdp_info_t *sdp)
// } else if (pt->type == 18) {
// pt->mime_type=rms_char_dup("g729", 1);
// }
- if (pt->mime_type)
- return pt;
- return NULL;
+ return pt;
}
PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp)
@@ -256,7 +254,7 @@ PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp)
while (payload_type_number) {
pt->type = atoi(payload_type_number);
pt = rms_sdp_check_payload_type(pt, sdp);
- if (pt) return pt;
+ if (pt->mime_type) return pt;
payload_type_number = strtok(NULL, " ");
}
if (!pt->mime_type) {