From a4168bee143dc62b4f21b2f166d083ed23d4167c Mon Sep 17 00:00:00 2001 From: Frederic-Philippe Metz Date: Tue, 23 Dec 2014 09:24:00 -0500 Subject: [PATCH] RTPENGINE-12_Fixed_Segmentation_fault_if_only_offer_received.patch --- daemon/call.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 6270dbd9d..307b9bfe9 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2500,19 +2500,21 @@ void call_destroy(struct call *c) { } found = 0; - // --- go through partner ml and search the RTP - for (k = ml->active_dialogue->medias.head; k; k = k->next) { - md = k->data; - - for (o = md->streams.head; o; o = o->next) { - ps2 = o->data; - if ((PS_ISSET(ps2, RTP) && !PS_ISSET(ps2, RTCP))) { - // --- only RTP is interesting - found = 1; - break; + if (ml->active_dialogue) { + // --- go through partner ml and search the RTP + for (k = ml->active_dialogue->medias.head; k; k = k->next) { + md = k->data; + + for (o = md->streams.head; o; o = o->next) { + ps2 = o->data; + if ((PS_ISSET(ps2, RTP) && !PS_ISSET(ps2, RTCP))) { + // --- only RTP is interesting + found = 1; + break; + } } + if (found) { break; } } - if (found) { break; } } if (ps && ps2 && ps->stats.packets!=0 && ps2->stats.packets==0)