]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure that the file position is not incremented beyond the total number of
authorRussell Bryant <russell@russellbryant.com>
Thu, 7 Dec 2006 18:14:13 +0000 (18:14 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 7 Dec 2006 18:14:13 +0000 (18:14 +0000)
files available for playback.  (issue #8539, ulogic)

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

res/res_musiconhold.c

index ccc61825788833660dcafba28a3fed87d381c0ee..c7f1fff6a27df966fcf8d12ac310b6b6399e4389 100644 (file)
@@ -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;
        }