Commit 55a88348 authored by Sébastien Toque's avatar Sébastien Toque

audio: fix crash if no more media to play

parent 7cb170b8
......@@ -792,7 +792,7 @@ public class AudioService extends Service {
mCurrentIndex = mNextIndex;
int size = mLibVLC.getMediaList().size();
if (size == 0 || mCurrentIndex >= size) {
if (size == 0 || mCurrentIndex < 0 || mCurrentIndex >= size) {
Log.w(TAG, "Warning: invalid next index, aborted !");
stop();
return;
......@@ -832,7 +832,7 @@ public class AudioService extends Service {
mCurrentIndex = mPrevIndex;
int size = mLibVLC.getMediaList().size();
if (size == 0 || mCurrentIndex >= size) {
if (size == 0 || mPrevIndex < 0 || mCurrentIndex >= size) {
Log.w(TAG, "Warning: invalid previous index, aborted !");
stop();
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment