]> git.sesse.net Git - kdenlive/commitdiff
effectstackview2.cpp: check for null pointer
authorMikko Rapeli <mikko.rapeli@iki.fi>
Fri, 10 Aug 2012 12:17:03 +0000 (14:17 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 2 Sep 2012 09:40:49 +0000 (11:40 +0200)
Fixes Coverity CID 709290: Dereference after null check (FORWARD_NULL)
Comparing "this->m_clipref" to null implies that "this->m_clipref" might be null.
717    else if (m_clipref) {
...
Passing null variable "this->m_clipref" to function "AbstractClipItem::info() const", which dereferences it. [show details]
733        info = m_clipref->info();

src/effectstack/effectstackview2.cpp

index 98591ba89b136cfb8db4b6cc03144d6d7705c841..c34527226277c3c686a94000495afd885fc1fcb8 100644 (file)
@@ -729,7 +729,7 @@ void EffectStackView2::slotCreateRegion(int ix, KUrl url)
         info.startPos = GenTime(-1);
         info.track = 0;
     }
-    else {
+    else if (m_clipref) {
         info = m_clipref->info();
     }
     CollapsibleEffect *current = getEffectByIndex(ix);
@@ -744,7 +744,7 @@ void EffectStackView2::slotCreateRegion(int ix, KUrl url)
     if (m_effectMetaInfo.trackMode) {
         isSelected = currentEffect->effectIndex() == 1;
     }
-    else {
+    else if (m_clipref) {
         isSelected = currentEffect->effectIndex() == m_clipref->selectedEffectIndex();
     }
     if (isSelected) currentEffect->setActive(true);