aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-07 18:14:13 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-07 18:14:13 +0000
commit6507d380929432b19b1783e5d14a33e0ebf05b32 (patch)
treeb6c25258eff40a2a56342fc3675fb6bc2ba2dee3
parent025375787d2890f198ce313845a9febc87ebab4c (diff)
Ensure that the file position is not incremented beyond the total number of
files available for playback. (issue #8539, ulogic) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@48356 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_musiconhold.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index ccc618257..c7f1fff6a 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -227,6 +227,7 @@ static int ast_moh_files_next(struct ast_channel *chan)
if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
state->pos++;
+ state->pos %= state->class->total_files;
return -1;
}