data: Properly access formats in capabilities structure when adding codecs.

Formats within a capabilities structure are addressed starting at 0, not 1.
Assuming 1 causes it to exceed an array.

ASTERISK-24389 #close
Reported by: Kevin Harwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2014-10-07 18:33:45 +00:00
parent 17d079c371
commit 673c2febba

View File

@@ -3146,7 +3146,7 @@ int ast_data_add_codecs(struct ast_data *root, const char *node_name, struct ast
}
count = ast_format_cap_count(cap);
for (i = 1; i <= count; ++i) {
for (i = 0; i < count; ++i) {
struct ast_format *fmt;
fmt = ast_format_cap_get_format(cap, i);