Browse code

rtp_media_server: fix crash in sdp payload pasring

Julien Chavanton authored on 08/07/2019 19:46:06
Showing 1 changed files
... ...
@@ -240,9 +240,7 @@ PayloadType *rms_sdp_check_payload_type(PayloadType *pt, rms_sdp_info_t *sdp)
240 240
 	//	} else if (pt->type == 18) {
241 241
 	//		pt->mime_type=rms_char_dup("g729", 1);
242 242
 	//	}
243
-	if (pt->mime_type)
244
-		return pt;
245
-	return NULL;
243
+	return pt;
246 244
 }
247 245
 
248 246
 PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp)
... ...
@@ -256,7 +254,7 @@ PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp)
256 256
 	while (payload_type_number) {
257 257
 		pt->type = atoi(payload_type_number);
258 258
 		pt = rms_sdp_check_payload_type(pt, sdp);
259
-		if (pt) return pt;
259
+		if (pt->mime_type) return pt;
260 260
 		payload_type_number = strtok(NULL, " ");
261 261
 	}
262 262
 	if (!pt->mime_type) {