]> git.sesse.net Git - kdenlive/commitdiff
Fix an invalid cast to ClipItem.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 25 Jan 2014 01:00:18 +0000 (02:00 +0100)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>
Sat, 25 Jan 2014 01:34:36 +0000 (02:34 +0100)
Seemingly we can get a Transition into this code path; qgraphicsitem_cast<>
will properly return NULL if it's not of the type we expect.

src/customtrackview.cpp

index 186552f19c27bfa5e2469f13fc1aa26352c96885..8786d494a07d09a914759dd1b2429f2a0f32f78e 100644 (file)
@@ -1091,7 +1091,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
         }
         m_selectionMutex.unlock();
         if (m_dragItem) {
-            ClipItem *clip = static_cast <ClipItem *>(m_dragItem);
+            ClipItem *clip = qgraphicsitem_cast<ClipItem *>(m_dragItem);
             updateClipTypeActions(dragGroup == NULL ? clip : NULL);
             m_pasteEffectsAction->setEnabled(m_copiedItems.count() == 1);
         }