Skip to content
GitLab
Menu
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
45c4e5e6
Commit
45c4e5e6
authored
Oct 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix freeze on memory usage loading invalid clips
parent
25ba5eaa
Pipeline
#36553
passed with stage
in 33 minutes and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/jobs/audiothumbjob.cpp
View file @
45c4e5e6
...
...
@@ -313,6 +313,12 @@ bool AudioThumbJob::startJob()
return
false
;
}
m_lengthInFrames
=
m_prod
->
get_length
();
// Multiply this if we want more than 1 sample per frame
if
(
m_lengthInFrames
==
INT_MAX
)
{
// This is a broken file or live feed, don't attempt to generate audio thumbnails
m_done
=
true
;
m_successful
=
false
;
return
false
;
}
m_frequency
=
m_binClip
->
audioInfo
()
->
samplingRate
();
m_frequency
=
m_frequency
<=
0
?
48000
:
m_frequency
;
...
...
src/jobs/loadjob.cpp
View file @
45c4e5e6
...
...
@@ -411,6 +411,19 @@ bool LoadJob::startJob()
m_errorMessage
.
append
(
i18n
(
"ERROR: Could not load clip %1: producer is invalid"
,
m_resource
));
return
false
;
}
if
(
m_producer
->
get_length
()
==
INT_MAX
&&
m_producer
->
get
(
"eof"
)
==
QLatin1String
(
"loop"
))
{
// This is a live source or broken clip
m_done
=
true
;
m_successful
=
false
;
if
(
m_producer
)
{
m_producer
.
reset
();
}
qDebug
()
<<
"=== MAX DURATION: "
<<
INT_MAX
<<
", DURATION: "
<<
(
INT_MAX
/
25
/
60
);
QMetaObject
::
invokeMethod
(
pCore
.
get
(),
"displayBinMessage"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QString
,
i18n
(
"Cannot get duration for file %1"
,
m_resource
)),
Q_ARG
(
int
,
(
int
)
KMessageWidget
::
Warning
));
m_errorMessage
.
append
(
i18n
(
"ERROR: Could not load clip %1: producer is invalid"
,
m_resource
));
return
false
;
}
processProducerProperties
(
m_producer
,
m_xml
);
QString
clipName
=
Xml
::
getXmlProperty
(
m_xml
,
QStringLiteral
(
"kdenlive:clipname"
));
if
(
clipName
.
isEmpty
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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