]> git.sesse.net Git - kdenlive/commitdiff
Fix crash when opening doc with a transition to track 0
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 5 Apr 2009 16:49:02 +0000 (16:49 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 5 Apr 2009 16:49:02 +0000 (16:49 +0000)
svn path=/trunk/kdenlive/; revision=3219

src/kdenlivedoc.cpp
src/trackview.cpp

index 0d5ea94b8a3a8dbd1f559b3072ea4ba527a27357..65d89cbeb922722c0fead887f3faf4700c67725b 100644 (file)
@@ -913,9 +913,9 @@ bool KdenliveDoc::convertDocument(double version)
         }
     }
 
-    //kDebug() << "/////////////////  CONVERTED DOC:";
-    //kDebug() << m_document.toString();
-    /*
+    /*kDebug() << "/////////////////  CONVERTED DOC:";
+    kDebug() << m_document.toString();
+    
     QFile file( "converted.kdenlive" );
     if ( file.open( QIODevice::WriteOnly ) ) {
       QTextStream stream( &file );
@@ -1584,7 +1584,7 @@ void KdenliveDoc::switchTrackLock(int ix, bool lock)
 
 bool KdenliveDoc::isTrackLocked(int ix) const
 {
-    return m_tracksList[ix].isLocked;
+    return m_tracksList.at(ix).isLocked;
 }
 
 void KdenliveDoc::switchTrackVideo(int ix, bool hide)
index 3f39bc75812c781417516d723ed3c2ed3feef271..72d33204317630b3b7ba902e1f8b3f897ed5fa5f 100644 (file)
@@ -187,6 +187,7 @@ void TrackView::parseDocument(QDomDocument doc)
                 m_doc->switchTrackVideo(i - 1, true);
                 m_doc->switchTrackAudio(i - 1, true);
             }
+
             trackduration = slotAddProjectTrack(pos, p, m_doc->isTrackLocked(i - 1));
             pos--;
             //kDebug() << " PRO DUR: " << trackduration << ", TRACK DUR: " << duration;
@@ -309,7 +310,7 @@ void TrackView::parseDocument(QDomDocument doc)
                 Transition *tr = new Transition(transitionInfo, a_track, m_doc->fps(), base, isAutomatic);
                 if (forceTrack) tr->setForcedTrack(true, a_track);
                 m_scene->addItem(tr);
-                if (m_doc->isTrackLocked(b_track - 1)) {
+                if (b_track > 0 && m_doc->isTrackLocked(b_track - 1)) {
                     tr->setItemLocked(true);
                 }
             }