mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Merge "res_stasis_playback: Prevent media_index from going out of bounds"
This commit is contained in:
@@ -287,6 +287,7 @@ static void play_on_channel(struct stasis_app_playback *playback,
|
||||
{
|
||||
int res;
|
||||
long offsetms;
|
||||
size_t index;
|
||||
|
||||
/* Even though these local variables look fairly pointless, they avoid
|
||||
* having a bunch of NULL's passed directly into
|
||||
@@ -305,7 +306,8 @@ static void play_on_channel(struct stasis_app_playback *playback,
|
||||
|
||||
offsetms = playback->offsetms;
|
||||
|
||||
for (; playback->media_index < AST_VECTOR_SIZE(&playback->medias); playback->media_index++) {
|
||||
for (index = 0; index < AST_VECTOR_SIZE(&playback->medias); index++) {
|
||||
playback->media_index = index;
|
||||
|
||||
/* Set the current media to play */
|
||||
ast_string_field_set(playback, media, AST_VECTOR_GET(&playback->medias, playback->media_index));
|
||||
|
Reference in New Issue
Block a user