]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix greedy_sort for codecs containing different fmtp
authorAndrey Volk <andywolk@gmail.com>
Thu, 6 Jul 2023 10:07:13 +0000 (13:07 +0300)
committerAndrey Volk <andywolk@gmail.com>
Mon, 31 Jul 2023 18:30:35 +0000 (21:30 +0300)
src/switch_core_media.c

index fb847d1862c11c0cbe07ffe9ef146e7a50143364..4d11dc8b4ef7ccbb9fd11b9d708ea766a26459d1 100644 (file)
@@ -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;
                        }
                }
        }