Skip to content

Commit

Permalink
MT#55283 fix possible NULL dereferences
Browse files Browse the repository at this point in the history
Change-Id: I4abd23c834d133c8f20f0a8038a78aa214cbc879
(cherry picked from commit 5171fd8)
  • Loading branch information
rfuchs committed Oct 17, 2023
1 parent 9a7a649 commit 0b47847
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 16 additions & 8 deletions daemon/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -2646,27 +2646,35 @@ static void __media_init_from_flags(struct call_media *other_media, struct call_
if (flags) {
switch (flags->media_echo) {
case MEO_FWD:
MEDIA_SET(media, ECHO);
if (media) {
MEDIA_SET(media, ECHO);
MEDIA_CLEAR(media, BLACKHOLE);
}
MEDIA_SET(other_media, BLACKHOLE);
MEDIA_CLEAR(media, BLACKHOLE);
MEDIA_CLEAR(other_media, ECHO);
break;
case MEO_BKW:
MEDIA_SET(media, BLACKHOLE);
if (media) {
MEDIA_SET(media, BLACKHOLE);
MEDIA_CLEAR(media, ECHO);
}
MEDIA_SET(other_media, ECHO);
MEDIA_CLEAR(media, ECHO);
MEDIA_CLEAR(other_media, BLACKHOLE);
break;
case MEO_BOTH:
MEDIA_SET(media, ECHO);
if (media) {
MEDIA_SET(media, ECHO);
MEDIA_CLEAR(media, BLACKHOLE);
}
MEDIA_SET(other_media, ECHO);
MEDIA_CLEAR(media, BLACKHOLE);
MEDIA_CLEAR(other_media, BLACKHOLE);
break;
case MEO_BLACKHOLE:
MEDIA_SET(media, BLACKHOLE);
if (media) {
MEDIA_SET(media, BLACKHOLE);
MEDIA_CLEAR(media, ECHO);
}
MEDIA_SET(other_media, BLACKHOLE);
MEDIA_CLEAR(media, ECHO);
MEDIA_CLEAR(other_media, ECHO);
case MEO_DEFAULT:
break;
Expand Down
2 changes: 2 additions & 0 deletions daemon/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,8 @@ static void transcode_rr(struct rtcp_process_ctx *ctx, struct report_block *rr)
struct ssrc_ctx *input_ctx = get_ssrc_ctx(map_ctx->ssrc_map_out,
ctx->mp->media_out->monologue->ssrc_hash,
SSRC_DIR_INPUT, NULL);
if (!input_ctx)
return;

// substitute our own values

Expand Down

0 comments on commit 0b47847

Please sign in to comment.