diff options
Diffstat (limited to 'main/format_pref.c')
-rw-r--r-- | main/format_pref.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/format_pref.c b/main/format_pref.c index 852b65035..48fac7731 100644 --- a/main/format_pref.c +++ b/main/format_pref.c @@ -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]; |