]> git.sesse.net Git - kdenlive/commitdiff
Fix crash when dropping effect from effects list to effect stack
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 4 Apr 2012 19:40:46 +0000 (21:40 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 4 Apr 2012 19:40:46 +0000 (21:40 +0200)
src/clipitem.cpp
src/effectslist.cpp

index 1f350225b13cdbe50ec1da04c6cebcae6377e398..0408213873ae4a679776bc7018e66d7927fd8247 100644 (file)
@@ -1415,6 +1415,7 @@ EffectsParameterList ClipItem::addEffect(QDomElement effect, bool /*animate*/)
     int ix;
     QDomElement insertedEffect;
     if (!effect.hasAttribute("kdenlive_ix")) {
+       // effect dropped from effect list
         ix = effectsCounter();
     } else ix = effect.attribute("kdenlive_ix").toInt();
     if (!m_effectList.isEmpty() && ix <= m_effectList.count()) {
index 2ceb03050a1fc63e1797a24a403b418e81b9926c..9d33f8e1298302c8139d2de2fb382b58e1e33dbb 100644 (file)
@@ -352,7 +352,7 @@ QDomElement EffectsList::insert(QDomElement effect)
     QDomNodeList effects = m_baseElement.childNodes();
     int ix = effect.attribute("kdenlive_ix").toInt();
     QDomElement result;
-    if (effect.hasAttribute("kdenlive_ix") && ix > effects.count()) {
+    if (ix <= 0 || ix > effects.count()) {
        ix = effects.count();
        result = m_baseElement.appendChild(importNode(effect, true)).toElement();
     }