Bug 442545

Summary: Kdenlive crashes after trying to save a project without video tracks
Product: [Applications] kdenlive Reporter: Eduardo Medina <edu.rm.85>
Component: User Interface & MiscellaneousAssignee: erjiang <erjiang>
Status: RESOLVED FIXED    
Severity: crash CC: erjiang, fritzibaby, julius.kuenzel
Priority: NOR    
Version First Reported In: 21.08.1   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 22.08
Sentry Crash Report:
Attachments: Creating a project without video tracks

Description Eduardo Medina 2021-09-16 17:35:18 UTC
Created attachment 141605 [details]
Creating a project without video tracks

SUMMARY

Hi, I use the Flatpak version of Kdenlive on Fedora 34 Workstation and I think I found a bug in the app (at least affects the Flatpak version took from Flathub).

After creating a project without video tracks, I try to save it with the "Save as" option. The saving process works as usual, but after clicking on Save button in GTK dialog, the app crashes.

I don't know if this occurs on KDE Plasma desktop or on other distributions, but I think it would be good to create project without video tracks if you only want to deal with sound files.

STEPS TO REPRODUCE
1. Create a project without video tracks in the Flatpak version (at least) of Kdenlive.
2. Try to save the project with the "Save as" process.
3. After press on Save button in GTK dialog (at least), the app crashes.

OBSERVED RESULT
The app crashes after saving a project without video tracks.

EXPECTED RESULT
To continue to use Kdenlive as usual.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 34 Workstation
(available in About System)
KDE Plasma Version: Branch 5.15 of KDE Application Platform according Flatpak list.
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 erjiang 2022-06-26 00:39:58 UTC
Confirmed, crash still exists in latest master (1d451a315). Crash is only when creating a new project with 0 video tracks. It doesn't seem to crash if you create a new project with video tracks but then delete them.

At timelinecontroller.cpp:2579, m_activeTrack == 3 and we try to getTrackPosition(3), leading to a failed assertion, Q_ASSERT(isTrack(trackId)), and an out of range bug.