]> git.sesse.net Git - kdenlive/commitdiff
coverity fix
authorVincent PINON <vincent.pinon@laposte.net>
Sat, 14 Dec 2013 14:49:16 +0000 (15:49 +0100)
committerVincent PINON <vincent.pinon@laposte.net>
Sat, 14 Dec 2013 14:49:16 +0000 (15:49 +0100)
src/commands/moveeffectcommand.cpp
src/customtrackview.cpp
src/doubleparameterwidget.cpp
src/jogshuttle.cpp

index 5be578e290608d8cf12e890ccbb513f09cbe35fa..50d49e491517c367b591ca6342622e5495740a65 100644 (file)
@@ -52,12 +52,14 @@ int MoveEffectCommand::id() const
 bool MoveEffectCommand::mergeWith(const QUndoCommand * other)
 {
     return false;
+    /* dead code (flaged by coverity), was removed to avoid crash when dropping on group
     if (other->id() != id()) return false;
     if (m_track != static_cast<const MoveEffectCommand*>(other)->m_track) return false;
     if (m_pos != static_cast<const MoveEffectCommand*>(other)->m_pos) return false;
     m_oldindex = static_cast<const MoveEffectCommand*>(other)->m_oldindex;
     m_newindex = static_cast<const MoveEffectCommand*>(other)->m_newindex;
     return true;
+    */
 }
 
 // virtual
index f6f64b3bfbad163b6899b88c430ee8dcb18d0779..c777d316fe790758e045c974edf04df22aae849b 100644 (file)
@@ -1224,8 +1224,10 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
             info.startPos = transitionClip->startPos();
         } else {
             GenTime transitionDuration(65, m_document->fps());
-            if (m_dragItem->cropDuration() < transitionDuration) info.startPos = m_dragItem->startPos();
-            else info.startPos = info.endPos - transitionDuration;
+            if (m_dragItem->cropDuration() < transitionDuration)
+                info.startPos = m_dragItem->startPos();
+            else
+                info.startPos = info.endPos - transitionDuration;
         }
         if (info.endPos == info.startPos) info.startPos = info.endPos - GenTime(65, m_document->fps());
         QDomElement transition = MainWindow::transitions.getEffectByTag("luma", "dissolve").cloneNode().toElement();
index ec2af5137f8ed18148e414be4e4d2ebf12a753a0..3281c674f9bfb63ce70429ba35693b7d230637d1 100644 (file)
@@ -32,6 +32,7 @@
 
 
 DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value, double min, double max, double defaultValue, const QString &comment, int id, const QString &suffix, int decimals, QWidget *parent) :
+    m_commentLabel(NULL),
     QWidget(parent)
 {
     setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
index 36ea3cd0fb13dbfa193fe03471c1bdbe814e278c..6a61812e8b927d5cfad461961ef8ceb185b7d895 100644 (file)
@@ -109,13 +109,15 @@ void ShuttleThread::run()
        int result, iof = -1;
 
        /* get fd settings */
-       if ((iof = fcntl(fd, F_GETFL, 0)) != -1) {
-               /* set fd non blocking */
-               fcntl(fd, F_SETFL, iof | O_NONBLOCK);
-       } else {
-               fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n");
-               return;
-       }
+    if ((iof = fcntl(fd, F_GETFL, 0)) == -1) {
+        fprintf(stderr, "Can't get Jog Shuttle file status\n");
+        close(fd);
+        return;
+    } else if (fcntl(fd, F_SETFL, iof | O_NONBLOCK) == -1) {
+        fprintf(stderr, "Can't set Jog Shuttle FILE DESCRIPTOR to O_NONBLOCK and stop thread\n");
+        close(fd);
+        return;
+    }
 
        /* enter thread loop */
        while (!stop_me) {