[asterisk-commits] branch 1.2 r31775 - /branches/1.2/res/res_musiconhold.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jun 3 10:02:50 MST 2006


Author: russell
Date: Sat Jun  3 12:02:49 2006
New Revision: 31775

URL: http://svn.digium.com/view/asterisk?rev=31775&view=rev
Log:
when using moh files mode, don't look for a file past the number of files
that have been loaded, or worse, past the size of the files array

Modified:
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?rev=31775&r1=31774&r2=31775&view=diff
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Sat Jun  3 12:02:49 2006
@@ -211,6 +211,8 @@
 
 			if (ast_test_flag(state->class, MOH_RANDOMIZE))
 				state->pos = rand();
+
+			state->pos %= state->class->total_files;
 
 			/* check to see if this file's format can be opened */
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) != -1)



More information about the asterisk-commits mailing list