]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_playback: Prevent media_index from going out of bounds
authorSean Bright <sean.bright@gmail.com>
Tue, 28 Jan 2020 19:23:19 +0000 (14:23 -0500)
committerSean Bright <sean.bright@gmail.com>
Wed, 29 Jan 2020 13:11:18 +0000 (08:11 -0500)
commit2a6b09e2e8e26736f1836d2e66fe464592b16a4f
treeedcd84ec84e999d6bdffc42d5b88997944a80120
parent35a782d58a3f52d6cbebb26a5e21a28d20841486
res_stasis_playback: Prevent media_index from going out of bounds

Incrementing stasis_app_playback.media_index directly in our playback
loop means that when we reach the end of our playlist the index into
the vector will be outside of the bounds of the vector.

Instead use a temporary variable and only assign when we're sure that
we are in bounds.

ASTERISK-28713 #close
Reported by: Sébastien Duthil

Change-Id: Ib53f7f156097e0607eb5871d9d78d246ed274928
res/res_stasis_playback.c