]> git.sesse.net Git - kdenlive/commitdiff
Fix Coverity #980682
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 12 Feb 2013 00:09:29 +0000 (01:09 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 12 Feb 2013 00:09:29 +0000 (01:09 +0100)
src/customtrackview.cpp

index 193f5ef9e39e11cc5a8450c5fac2cf8bfe86be77..e4a15b8e89737e9c2a1ab9f18c5e09685917ed02 100644 (file)
@@ -5461,13 +5461,15 @@ void CustomTrackView::slotAddClipExtraData(const QString &id, const QString &key
 
 void CustomTrackView::slotAddClipMarker(const QString &id, QList <CommentedTime> newMarkers, QUndoCommand *groupCommand)
 {
-    QUndoCommand *subCommand = NULL;
+    DocClipBase *base = m_document->clipManager()->getClipById(id);
+    if (!base) return;
+    QUndoCommand *subCommand = NULL;    
     if (newMarkers.count() > 1 && groupCommand == NULL) {
        subCommand = new QUndoCommand;
        subCommand->setText("Add markers");
     }
     for (int i = 0; i < newMarkers.count(); i++) {
-       CommentedTime oldMarker = m_document->clipManager()->getClipById(id)->markerAt(newMarkers.at(i).time());
+       CommentedTime oldMarker = base->markerAt(newMarkers.at(i).time());
        if (oldMarker == CommentedTime()) {
            oldMarker = newMarkers.at(i);
            oldMarker.setMarkerType(-1);