Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix crash on dragging clip with no audio or no video track

CCBUG: 402561
parent 51f1992a
......@@ -366,7 +366,9 @@ int TimelineModel::getMirrorVideoTrackId(int trackId) const
return -1;
}
int count = 0;
++it;
if (it != m_allTracks.end()) {
++it;
}
while (it != m_allTracks.end()) {
if ((*it)->isAudioTrack()) {
count++;
......@@ -378,7 +380,7 @@ int TimelineModel::getMirrorVideoTrackId(int trackId) const
}
++it;
}
if (!(*it)->isAudioTrack() && count == 0) {
if (it != m_allTracks.end() && !(*it)->isAudioTrack() && count == 0) {
return (*it)->getId();
}
return -1;
......@@ -402,7 +404,9 @@ int TimelineModel::getMirrorAudioTrackId(int trackId) const
return -1;
}
int count = 0;
--it;
if (it != m_allTracks.begin()) {
--it;
}
while (it != m_allTracks.begin()) {
if (!(*it)->isAudioTrack()) {
count++;
......@@ -414,7 +418,7 @@ int TimelineModel::getMirrorAudioTrackId(int trackId) const
}
--it;
}
if ((*it)->isAudioTrack() && count == 0) {
if (it != m_allTracks.begin() && (*it)->isAudioTrack() && count == 0) {
return (*it)->getId();
}
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment