From 41507363f3fffcdad547b168e55fbe3383a24c3d Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 6 Jul 2023 13:07:13 +0300 Subject: [PATCH] [Core] Fix greedy_sort for codecs containing different fmtp --- src/switch_core_media.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index fb847d1862..4d11dc8b4e 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -4518,8 +4518,9 @@ static void greedy_sort(switch_media_handle_t *smh, struct matches *matches, int const switch_codec_implementation_t *imp = codec_array[g]; for(j = 0; j < m_idx; j++) { - if (mtmp[j].imp == imp) { + if (mtmp[j].imp && mtmp[j].imp == imp) { *&matches[f++] = *&mtmp[j]; + mtmp[j].imp = NULL; } } }