From 76bfb0e7076717d4a9f672a1c30dc8cf8b808eeb Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 20 Jan 2025 08:32:50 -0400 Subject: [PATCH] MT#55283 don't accept incompatible codecs A matching payload type number in an answer might not be enough to establish compatible codecs. Also check the format parameters. Reject and ignore answer codecs that are not compatible. Change-Id: I12a1287216886926ec4b3c704029c923f815b429 (cherry picked from commit 9c00f30475a414b24d0d935d7df43bc3cd88a352) (cherry picked from commit 71ff9210ceb1b6c2711313722b0d74c2b5e4daf7) --- daemon/codec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/codec.c b/daemon/codec.c index 08e5f5b35..622b008fb 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -5206,6 +5206,8 @@ void __codec_store_populate(struct codec_store *dst, struct codec_store *src, st rtp_payload_type *pt = l->data; rtp_payload_type *orig_pt = t_hash_table_lookup(orig_dst.codecs, GINT_TO_POINTER(pt->payload_type)); + if (orig_pt && !rtp_payload_type_eq_compat(orig_pt, pt)) + orig_pt = NULL; if (a.answer_only && !orig_pt) { if (a.allow_asymmetric) orig_pt = codec_store_find_compatible(&orig_dst, pt);