From 065fbc0428b31755dbb97d684ccb31759b805ea1 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 19 Nov 2019 22:14:43 +0900 Subject: [PATCH] return nullptr if a TrackReference references a track that doesn't exist Fixes assert trying to access an array location that doesn't exist. --- app/node/output/timeline/tracklist.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/node/output/timeline/tracklist.cpp b/app/node/output/timeline/tracklist.cpp index b31be3cf2..51e0d06fa 100644 --- a/app/node/output/timeline/tracklist.cpp +++ b/app/node/output/timeline/tracklist.cpp @@ -108,6 +108,10 @@ const QVector &TrackList::Tracks() TrackOutput *TrackList::TrackAt(int index) { + if (index < 0 || index >= track_cache_.size()) { + return nullptr; + } + return track_cache_.at(index); }