]> git.sesse.net Git - kdenlive/commitdiff
Fix crash when opening a project with speed effect:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 1 Sep 2009 20:51:09 +0000 (20:51 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 1 Sep 2009 20:51:09 +0000 (20:51 +0000)
http://www.kdenlive.org/mantis/view.php?id=1112

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

src/clipitem.cpp

index 42aade2926a7e775cf663234dababb0ee0d7e1c3..279a73766342c0c2203172df4bfb79d1d6acfbe2 100644 (file)
@@ -1269,8 +1269,12 @@ void ClipItem::setEffectAt(int ix, QDomElement effect)
 EffectsParameterList ClipItem::addEffect(const QDomElement effect, bool animate)
 {
     bool needRepaint = false;
-    int ix = effect.attribute("kdenlive_ix").toInt();
-    if (ix <= m_effectList.count()) {
+    int ix;
+    if (!effect.hasAttribute("kdenlive_ix")) {
+        ix = effectsCounter();
+    }
+    else ix = effect.attribute("kdenlive_ix").toInt();
+    if (!m_effectList.isEmpty() && ix <= m_effectList.count()) {
         needRepaint = true;
         m_effectList.insert(ix - 1, effect);
         for (int i = ix; i < m_effectList.count(); i++) {