Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
47203736
Commit
47203736
authored
Mar 02, 2020
by
Jean-Baptiste Mardelle
Browse files
Add some safety checks on paste clips.
Related to
#581
parent
bc3e0604
Pipeline
#15886
passed with stage
in 13 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinefunctions.cpp
View file @
47203736
...
...
@@ -1256,6 +1256,10 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
for
(
int
i
=
0
;
i
<
clips
.
count
();
i
++
)
{
QDomElement
prod
=
clips
.
at
(
i
).
toElement
();
int
trackPos
=
prod
.
attribute
(
QStringLiteral
(
"track"
)).
toInt
();
if
(
trackPos
<
0
||
trackPos
>=
projectTracks
.
first
.
size
()
+
projectTracks
.
second
.
size
())
{
pCore
->
displayMessage
(
i18n
(
"Not enough tracks to paste clipboard"
),
InformationMessage
,
500
);
return
false
;
}
bool
audioTrack
=
prod
.
hasAttribute
(
QStringLiteral
(
"audioTrack"
));
if
(
audioTrack
)
{
if
(
!
audioTracks
.
contains
(
trackPos
))
{
...
...
@@ -1352,6 +1356,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
int
newPos
=
masterIx
+
tk
-
masterSourceTrack
;
if
(
newPos
<
0
||
newPos
>=
projectTracks
.
second
.
size
())
{
pCore
->
displayMessage
(
i18n
(
"Not enough tracks to paste clipboard"
),
InformationMessage
,
500
);
return
false
;
}
tracksMap
.
insert
(
tk
,
projectTracks
.
second
.
at
(
newPos
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment