avfilter/buffersrc: Use av_frame_clone() where appropriate

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-07 12:07:30 +02:00
parent 185d0acdc7
commit 67cc7aaa51
1 changed files with 5 additions and 8 deletions

View File

@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (!(copy = av_frame_alloc()))
return AVERROR(ENOMEM);
if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
if (!(copy = av_frame_alloc()))
return AVERROR(ENOMEM);
av_frame_move_ref(copy, frame);
} else {
ret = av_frame_ref(copy, frame);
if (ret < 0) {
av_frame_free(&copy);
return ret;
}
copy = av_frame_clone(frame);
if (!copy)
return AVERROR(ENOMEM);
}
#if FF_API_PKT_DURATION