]> git.sesse.net Git - kdenlive/commitdiff
Make sure we don't try to insert a clip in non existing track:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 16 Jun 2009 07:05:55 +0000 (07:05 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 16 Jun 2009 07:05:55 +0000 (07:05 +0000)
http://www.kdenlive.org:80/mantis/view.php?id=912
(Fixes the crash but not the real  cause for this bug)

svn path=/trunk/kdenlive/; revision=3548

src/customtrackview.cpp
src/renderer.cpp

index 1904cd76880447d038f29b48a411fc9e03489478..97b14501b8b17d40c0160db5c67b15cea8e54911 100644 (file)
@@ -4071,7 +4071,7 @@ void CustomTrackView::slotUpdateAllThumbs()
     QList<QGraphicsItem *> itemList = items();
     //if (itemList.isEmpty()) return;
     ClipItem *item;
-    QString thumbBase = m_document->projectFolder().path() + "/thumbs/";
+    const QString thumbBase = m_document->projectFolder().path() + "/thumbs/";
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == AVWIDGET) {
             item = static_cast <ClipItem *>(itemList.at(i));
index ea4b72a544fd96078f2d82df90a822833f9fb12e..6ebc8b17a7f08c6ccf61ad27b5cb81ff3113631c 100644 (file)
@@ -1375,6 +1375,10 @@ void Render::mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *pr
 
     Mlt::Service service(parentProd.get_service());
     Mlt::Tractor tractor(service);
+    if (info.track > tractor.count() - 1) {
+        kDebug() << "ERROR TRYING TO INSERT CLIP ON TRACK " << info.track << ", at POS: " << info.startPos.frames(25);
+        return;
+    }
     mlt_service_lock(service.get_service());
     Mlt::Producer trackProducer(tractor.track(info.track));
     Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());