Browse Source

TT#14008 fix possible null pointer

closes #1152

Change-Id: I3c6ac0e57128dfc567cecb3e7c952b5c96175f84
pull/1163/head
Richard Fuchs 5 years ago
parent
commit
d8b71e11fd
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      daemon/media_socket.c

+ 11
- 4
daemon/media_socket.c View File

@ -1213,6 +1213,11 @@ static void __stream_update_stats(struct packet_stream *ps, int have_in_lock) {
mutex_lock(&ps->in_lock);
struct ssrc_ctx *ssrc_ctx = ps->ssrc_in;
if (!ssrc_ctx) {
if (!have_in_lock)
mutex_unlock(&ps->in_lock);
return;
}
struct ssrc_entry_call *parent = ssrc_ctx->parent;
__re_address_translate_ep(&local, &ps->selected_sfd->socket.local);
@ -1250,10 +1255,12 @@ static void __stream_update_stats(struct packet_stream *ps, int have_in_lock) {
return; // will have to skip this
}
ssrc_ctx = ps->ssrc_out;
parent = ssrc_ctx->parent;
if (parent->h.ssrc == ssrc_map_out) {
atomic64_add(&ssrc_ctx->packets, stats.basic_stats.packets);
atomic64_add(&ssrc_ctx->octets, stats.basic_stats.bytes);
if (ssrc_ctx) {
parent = ssrc_ctx->parent;
if (parent->h.ssrc == ssrc_map_out) {
atomic64_add(&ssrc_ctx->packets, stats.basic_stats.packets);
atomic64_add(&ssrc_ctx->octets, stats.basic_stats.bytes);
}
}
mutex_unlock(&ps->out_lock);
}


Loading…
Cancel
Save