Skip to content
Snippets Groups Projects
Commit ebf76500 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

MediaList: increase count after items move

Prevent ArrayIndexOutOfBoundsException

(cherry picked from commit 1f245e48)
parent 1a1248f8
No related branches found
No related tags found
No related merge requests found
......@@ -104,10 +104,9 @@ public class MediaList extends VLCObject<MediaList.Event> {
}
private synchronized Media insertMediaFromEvent(int index) {
mCount++;
for (int i = mCount - 1; i >= index; --i)
mMediaArray.put(i + 1, mMediaArray.valueAt(i));
mCount++;
final Media media = new Media(this, index);
mMediaArray.put(index, media);
return media;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment