]> 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:15:41 +0000 (07:15 -0600)
commit8b8c1dd07f722fadc55c712c32189e6479e06f00
treec90b8d830a8bff63e8e074735461b70f240ee5cf
parente86c32b878f8e3dc0a4d696cc7b1837c965ba3ab
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