Bug 439524

Summary: Copying grouped subtitles causes crash
Product: [Applications] kdenlive Reporter: ada <emailada>
Component: Rendering & ExportAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED FIXED    
Severity: crash CC: fritzibaby
Priority: NOR Flags: fritzibaby: Brainstorm+
Version First Reported In: 21.04.2   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: crash-log_subtitle

Description ada 2021-07-05 16:29:17 UTC
SUMMARY


STEPS TO REPRODUCE
1. Make a few subtitle clips using the subtitler
2. Group them & ctrl+c the group
3. Ctrl+v crashes kdenlive

OBSERVED RESULT
Crash

EXPECTED RESULT
pasted the group of subtitles

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ubuntu studio 20.10
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
MLT version: 6.26.1
This is from the apt version of kdenlive
Comment 1 ada 2021-07-05 16:40:44 UTC
Tried it on apt, flatpak & snap and get the same result.
Comment 2 emohr 2021-08-01 10:23:13 UTC
I created 5 subtitles (containing special character). Select the 5 subtitle (shift+left mouse). CTRL+c and paste them -> no crash. 

What do you mean by "group"? 

Please try with the AppImage to see if there are any packaging issues
Comment 3 ada 2021-08-01 14:33:24 UTC
I just tried this on the 21.04.3b appimage and its still there.
(This was on Debian Buster + plasma desktop tho)

steps to reproduce:
(shift+s) Make some subtitle clips
(ctrl+g) Group them with 
(ctrl+c) Copy the group
(move the cursor)
(ctrl+v) paste the group 


I launched from terminal and this was the output from "Grouping items" until the crash:

```
==========GROUPING ITEMS:  3
qml: TRIGGERING VERTICAL STOP:  112 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  108 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  96 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  89 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  84 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  78 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  74 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  70 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  69 , SCROLL:  0 SCH: 340
qml: TRIGGERING VERTICAL STOP:  68 , SCROLL:  0 SCH: 340
qml: Got rubber bottom:  -73  - height:  46 , TK y:  0 , SCROLLVIEWY:  0
==========GROUPING ITEMS:  3
==========GROUPING ITEMS:  3
qml: ENTERED SUBTITLE MOUSE AREA
qml: ENTERED SUBTITLE MOUSE AREA
qml: ENTER MOUSE END AREA
qml: ENTERED SUBTITLE MOUSE AREA
qml: ENTERED ITEM CLCKD
qml: RELEASED DONE

_______________
==============
 GROUP ROOTS: 
GROUP:  11

=======
 / // / PASTED DOC: 

 "<kdenlive-scene offset=\"145\" masterTrack=\"-1\" documentid=\"1627827954524\">\n <subtitle text=\"hello2\" in=\"145\" out=\"270\"/>\n <subtitle text=\"!!!\" in=\"395\" out=\"520\"/>\n <subtitle text=\"4hello2\" in=\"270\" out=\"395\"/>\n <bin/>\n <groups>[\n    {\n        \"children\": [\n            {\n                \"data\": \"-1:395\",\n                \"leaf\": \"subtitle\",\n                \"type\": \"Leaf\"\n            },\n            {\n                \"data\": \"-1:270\",\n                \"leaf\": \"subtitle\",\n                \"type\": \"Leaf\"\n            },\n            {\n                \"data\": \"-1:145\",\n                \"leaf\": \"subtitle\",\n                \"type\": \"Leaf\"\n            }\n        ],\n        \"type\": \"Normal\"\n    }\n]\n</groups>\n</kdenlive-scene>\n" 

------------
qml: ENTER MOUSE END AREA
qml: ENTERED SUBTITLE MOUSE AREA
qml: ENTERED SUBTITLE MOUSE AREA
 / / READING CLIPS FROM CLIPBOARD
Added to model
srt file import
Saving subtitle filter:  "/tmp/1627827954524.srt"
Added to model
srt file import
Saving subtitle filter:  "/tmp/1627827954524.srt"
Added to model
srt file import
Saving subtitle filter:  "/tmp/1627827954524.srt"
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
/tmp/.mount_kdenliv3vR6G/AppRun: line 42:  4472 Aborted                 kdenlive --config kdenlive-appimagerc $@

```
Comment 4 Bug Janitor Service 2021-08-16 04:36:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 emohr 2021-08-16 15:45:11 UTC
Created attachment 140774 [details]
crash-log_subtitle

Thank you for reporting. I can confirm the crash following your steps. Attached the crash log.
Comment 6 Julius Künzel 2021-09-01 11:26:44 UTC
Git commit 1ba83ecfe724fd4e6fa576d498d40b3c3c94f615 by Julius Künzel.
Committed on 01/09/2021 at 11:25.
Pushed by jlskuz into branch 'release/21.08'.

Fix crash on pasting grouped subtitle

M  +2    -2    src/timeline2/model/groupsmodel.cpp

https://invent.kde.org/multimedia/kdenlive/commit/1ba83ecfe724fd4e6fa576d498d40b3c3c94f615