Skip to content

Commit

Permalink
Fixed bounds checking in PlaybackService::GetTrack.
Browse files Browse the repository at this point in the history
  • Loading branch information
clangen committed Nov 26, 2016
1 parent 5ac6f41 commit 64a187d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/musikbox/app/service/PlaybackService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 64a187d

Please sign in to comment.