Bug 480316 - Crash when cutting at where subtitles overlay
Summary: Crash when cutting at where subtitles overlay
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: User Interface & Miscellaneous (show other bugs)
Version: git-master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-25 13:01 UTC by red_Arti
Modified: 2024-01-26 05:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
crash-project-and-record-screen (1.01 MB, application/zip)
2024-01-25 13:01 UTC, red_Arti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description red_Arti 2024-01-25 13:01:10 UTC
Created attachment 165210 [details]
crash-project-and-record-screen

SUMMARY
If there's overlaying subtitles in timeline, Kdenlive crashes when cutting at the position.

(Watch the screen recording video in attachment)

STEPS TO REPRODUCE
1. Create project and add a video clip to timeline
2. Add some subtitles. Make two overlays each other
3. Select all subtitles, group them
4. Select everything in timeline (the grouped subtitles and the video clip), group them again
5. Select the video and set time point at where the overlaying is
6. Right-click video clip and click "Cut Clip"

Download the project file in attachment to reproduce.
Notice: if you want to reproduce, remember to delete cache folder everytime before opening the project, because cache will make subtitle timeline looks different

OBSERVED RESULT
Crash

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Tested with:
1. Kdenlive latest git branch 23.08 ci build AppImage
2. Kdenlive git master ci build AppImage

ADDITIONAL INFORMATION
Terminal log:
Editing existing subtitle in model
srt/vtt/sbv file import
Saving subtitle filter:  "/tmp/1706185988931.srt"
Deleting subtitle in model
No Subtitle at pos in model
Segment fault
Comment 1 Jean-Baptiste Mardelle 2024-01-25 17:41:07 UTC
Thanks for the report. This happens because the way subtitles are implemented, two subtitles cannot start at the same position (not sure it is even allowed in the srt specs). Cutting overlapping subtitles creates 2 subtitles starting at the same position, causing the crash. Not sure what is the best fix here: don't allow the cut, cut only one of the subtitles.. 

WIll think about it, ideas welcome.
Comment 2 Jean-Baptiste Mardelle 2024-01-26 05:31:14 UTC
Git commit 281972a5c12d808aa3664c5273b32ec3462c090e by Jean-Baptiste Mardelle.
Committed on 26/01/2024 at 06:30.
Pushed by mardelle into branch 'release/24.02'.

Fix crash cutting grouped overlapping subtitles. Don't allow the cut anymore, add test
Fix cut clips on all tracks not cutting subtitles

M  +34   -7    src/timeline2/model/timelinefunctions.cpp
M  +2    -10   src/timeline2/view/timelinecontroller.cpp
M  +15   -0    tests/subtitlestest.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/281972a5c12d808aa3664c5273b32ec3462c090e
Comment 3 Jean-Baptiste Mardelle 2024-01-26 05:33:44 UTC
Git commit aa64e82c9e6d652f7581f37da800ee38df3a696f by Jean-Baptiste Mardelle.
Committed on 26/01/2024 at 06:33.
Pushed by mardelle into branch 'release/23.08'.

Fix crash cutting grouped overlapping subtitles. Don't allow the cut anymore, add test
Fix cut clips on all tracks not cutting subtitles

M  +34   -7    src/timeline2/model/timelinefunctions.cpp
M  +2    -10   src/timeline2/view/timelinecontroller.cpp
M  +15   -0    tests/subtitlestest.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/aa64e82c9e6d652f7581f37da800ee38df3a696f