From 2ef93af892830643165dd7cd78feda88e687652c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 28 Apr 2020 11:36:36 -0400 Subject: [PATCH] TT#79601 fix possible crash when injecting DTMF Change-Id: I3bfdd7085d193a4e1b6719313b64ed70c1dca7a8 --- daemon/dtmf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/dtmf.c b/daemon/dtmf.c index 4816baf12..33db8554d 100644 --- a/daemon/dtmf.c +++ b/daemon/dtmf.c @@ -268,8 +268,10 @@ const char *dtmf_inject(struct call_media *media, int code, int volume, int dura struct codec_handler *ch = codec_handler_get(media, pt); if (!ch) return "No matching codec handler"; - if (ch->output_handler) // context switch if we have multiple inputs going to one output + if (ch->output_handler && ch->output_handler->ssrc_hash) // context switch if we have multiple inputs going to one output ch = ch->output_handler; + if (!ch->ssrc_hash) + return "No suitable codec handler present"; struct codec_ssrc_handler *csh = get_ssrc(ssrc_in->parent->h.ssrc, ch->ssrc_hash); if (!csh) return "No matching codec SSRC handler";