Fix possible crash on render

CCBUG: 352670
parent d2731644
......@@ -169,12 +169,12 @@ int Timeline::duration() const
bool Timeline::checkProjectAudio()
{
bool hasAudio = false;
int max = m_tractor->count();
int max = m_tracks.count();
for (int i = 0; i < max; i++) {
Track *sourceTrack = track(i);
QScopedPointer<Mlt::Producer> track(m_tractor->track(i));
QScopedPointer<Mlt::Producer> track(m_tractor->track(i + 1));
int state = track->get_int("hide");
if (sourceTrack->hasAudio() && !(state & 2)) {
if (sourceTrack && sourceTrack->hasAudio() && !(state & 2)) {
hasAudio = true;
break;
}
......
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