chan_iax2: Fix a crash when using chan_iax2 jitterbuffer settings
authorJonathan Rose <jrose@digium.com>
Fri, 19 Sep 2014 15:11:06 +0000 (15:11 +0000)
committerJonathan Rose <jrose@digium.com>
Fri, 19 Sep 2014 15:11:06 +0000 (15:11 +0000)
Caused by format changes in Asterisk 13

ASTERISK-24265 #close
Reported by: Dafi Ni
Review: https://reviewboard.asterisk.org/r/3999/
........

Merged revisions 423524 from http://svn.asterisk.org/svn/asterisk/branches/13

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

channels/chan_iax2.c

index 1f37904..a3fb34c 100644 (file)
@@ -4123,7 +4123,7 @@ static void __get_from_jb(const void *p)
        if(ms >= (next = jb_next(pvt->jb))) {
                struct ast_format *voicefmt;
                voicefmt = ast_format_compatibility_bitfield2format(pvt->voiceformat);
-               ret = jb_get(pvt->jb, &frame, ms, ast_format_get_default_ms(voicefmt));
+               ret = jb_get(pvt->jb, &frame, ms, voicefmt ? ast_format_get_default_ms(voicefmt) : 20);
                switch(ret) {
                case JB_OK:
                        fr = frame.data;