Fixed bounds checking in PlaybackService::GetTrack.

This commit is contained in:
casey langen 2016-11-25 16:09:23 -08:00
parent 5ac6f416db
commit 64a187d1b8

View File

@ -437,7 +437,9 @@ double PlaybackService::GetDuration() {
IRetainedTrack* PlaybackService::GetTrack(size_t index) {
boost::recursive_mutex::scoped_lock lock(this->playlistMutex);
if (index >= 0 && index < this->playlist.Count()) {
const size_t count = this->playlist.Count();
if (count && index >= 0 && index < this->playlist.Count()) {
return new RetainedTrack(this->playlist.Get(index));
}