From f224babc54bc0bf8db97ee96d74987225fa26301 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 18 Feb 2015 08:55:58 -0500 Subject: [PATCH] segfault fix if no rtpmap attribute is present --- daemon/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 2a14fe6e9..e869d621b 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -1050,7 +1050,7 @@ static int __rtp_payload_types(struct stream_params *sp, struct sdp_media *media /* first go through a=rtpmap and build a hash table of attrs */ ht = g_hash_table_new(g_int_hash, g_int_equal); q = attr_list_get_by_id(&media->attributes, ATTR_RTPMAP); - for (ql = q->head; ql; ql = ql->next) { + for (ql = q ? q->head : NULL; ql; ql = ql->next) { struct rtp_payload_type *pt; attr = ql->data; pt = &attr->u.rtpmap.rtp_pt;