mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Handle case where an unknown format is used to get the preferred codec size
In ast_codec_pref_getsize, if an unknown format is passed to the method, no preferred codec will be selected and a negative number will be used to index into the format list. The method now logs an unknown format as a warning, and returns an empty format list. (issue ASTERISK-19655) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1863/ ........ Merged revisions 362377 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -274,6 +274,11 @@ struct ast_format_list ast_codec_pref_getsize(struct ast_codec_pref *pref, struc
|
||||
}
|
||||
}
|
||||
|
||||
if (idx < 0) {
|
||||
ast_log(AST_LOG_WARNING, "Format %s unknown; unable to get preferred codec packet size\n", ast_getformatname(format));
|
||||
return fmt;
|
||||
}
|
||||
|
||||
for (x = 0; x < f_len; x++) {
|
||||
if (pref->order[x] == (idx + 1)) {
|
||||
framems = pref->framing[x];
|
||||
|
Reference in New Issue
Block a user