Browse Source

fix segfault regression from e84fd86

closes #470

Change-Id: I3ce83e4fdc5fe8113932bb51ec3375c6144814ae
changes/21/19321/1
Richard Fuchs 8 years ago
parent
commit
14262f56fa
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      daemon/call.c

+ 4
- 3
daemon/call.c View File

@ -931,7 +931,7 @@ enum call_stream_state call_stream_state_machine(struct packet_stream *ps) {
if (MEDIA_ISSET(media, DTLS)) { if (MEDIA_ISSET(media, DTLS)) {
mutex_lock(&ps->in_lock); mutex_lock(&ps->in_lock);
struct stream_fd *sfd = dtls_sfd(ps); struct stream_fd *sfd = dtls_sfd(ps);
if (sfd->dtls.init && !sfd->dtls.connected) {
if (sfd && sfd->dtls.init && !sfd->dtls.connected) {
dtls(sfd, NULL, NULL); dtls(sfd, NULL, NULL);
mutex_unlock(&ps->in_lock); mutex_unlock(&ps->in_lock);
return CSS_DTLS; return CSS_DTLS;
@ -952,7 +952,7 @@ void call_media_state_machine(struct call_media *m) {
static int __init_stream(struct packet_stream *ps) { static int __init_stream(struct packet_stream *ps) {
struct call_media *media = ps->media; struct call_media *media = ps->media;
struct call *call = ps->call; struct call *call = ps->call;
int active;
int active = -1;
if (MEDIA_ISSET(media, SDES)) { if (MEDIA_ISSET(media, SDES)) {
for (GList *l = ps->sfds.head; l; l = l->next) { for (GList *l = ps->sfds.head; l; l = l->next) {
@ -964,7 +964,8 @@ static int __init_stream(struct packet_stream *ps) {
if (MEDIA_ISSET(media, DTLS) && !PS_ISSET(ps, FALLBACK_RTCP)) { if (MEDIA_ISSET(media, DTLS) && !PS_ISSET(ps, FALLBACK_RTCP)) {
struct stream_fd *sfd = dtls_sfd(ps); struct stream_fd *sfd = dtls_sfd(ps);
active = dtls_is_active(&sfd->dtls);
if (sfd)
active = dtls_is_active(&sfd->dtls);
// we try to retain our role if possible, but must handle a role switch // we try to retain our role if possible, but must handle a role switch
if ((active && !MEDIA_ISSET(media, SETUP_ACTIVE)) if ((active && !MEDIA_ISSET(media, SETUP_ACTIVE))
|| (!active && !MEDIA_ISSET(media, SETUP_PASSIVE))) || (!active && !MEDIA_ISSET(media, SETUP_PASSIVE)))


Loading…
Cancel
Save