chan_iax2: Fix a crash that occurs when using allow=all for an IAX2 peer
authorJonathan Rose <jrose@digium.com>
Tue, 5 Aug 2014 13:59:53 +0000 (13:59 +0000)
committerJonathan Rose <jrose@digium.com>
Tue, 5 Aug 2014 13:59:53 +0000 (13:59 +0000)
Or any combination of codecs that includes Opus.

ASTERISK-24107 #close
Review: https://reviewboard.asterisk.org/r/3885/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/format.c

index 83206f2..e54fca0 100644 (file)
@@ -247,7 +247,7 @@ enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const s
 
        interface = format1->interface ? format1->interface : format2->interface;
 
-       if (interface) {
+       if (interface && interface->format_cmp) {
                return interface->format_cmp(format1, format2);
        }