playlist.c fix old out of bounds read
In case next_index == -1, this would read before the start of the playlist->indices buffer. Change-Id: I0a32a31c7c97c755a1217b8bea90a650f9e36a93
This commit is contained in:
parent
5d0c382a59
commit
5bb062391f
1 changed files with 2 additions and 1 deletions
|
@ -1828,7 +1828,8 @@ static int get_next_index(const struct playlist_info* playlist, int steps,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No luck if the whole playlist was bad. */
|
/* No luck if the whole playlist was bad. */
|
||||||
if (playlist->indices[next_index] & PLAYLIST_SKIPPED)
|
if (next_index < 0 || next_index >= playlist->amount ||
|
||||||
|
playlist->indices[next_index] & PLAYLIST_SKIPPED)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return next_index;
|
return next_index;
|
||||||
|
|
Loading…
Reference in a new issue