]> git.sesse.net Git - kdenlive/blobdiff - src/clipdurationdialog.cpp
Fix possible clip corruption due to insufficient checking in duration dialog
[kdenlive] / src / clipdurationdialog.cpp
index 18838af418fcde95b3bcf26be163496fdff61cc6..920ca288e522d709fc35e3bc3ffeaaf176a09172 100644 (file)
@@ -144,13 +144,14 @@ void ClipDurationDialog::slotCheckEnd()
 {
     GenTime cropStart = m_cropStart->gentime();
     GenTime cropEnd = m_cropEnd->gentime();
-    GenTime duration = m_clip->maxDuration() - cropStart - cropEnd;
+    GenTime duration = m_clip->maxDuration() - cropEnd - cropStart;
 
     if (duration >= GenTime()) {
         m_dur->setValue(duration);
+        slotCheckDuration();
     } else {
         m_cropEnd->blockSignals(true);
-        m_cropEnd->setValue(m_clip->maxDuration() - cropStart - m_dur->gentime());
+        m_cropEnd->setValue(m_clip->maxDuration() - m_dur->gentime() - cropStart);
         m_cropEnd->blockSignals(false);
     }
 }