fixed crash when file contains no valid frames #601

This commit is contained in:
itsmattkc
2019-03-05 10:12:34 -08:00
parent 27d77abdc2
commit f9e7c3a3dd
3 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -668,7 +668,7 @@ void Cacher::CacheVideoWorker() {
qWarning() << clip->name() << "frame had no PTS value";
av_frame_free(&decoded_frame);
if (retrieve_code == AVERROR_EOF && retrieved_frame == nullptr) {
if (retrieve_code == AVERROR_EOF && retrieved_frame == nullptr && !queue.isEmpty()) {
// if we reached the end of the file, it's not an error but there are no more frames to retrieve
// some formats EOF before the end of the duration that Olive calculates. In this event, we simply
// return the last frame we retrieved