aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/buffersrc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 12:07:30 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-10 11:19:20 +0200
commit67cc7aaa51fcd781ac5920d3c739e28c81cbb0cb (patch)
tree0cb86f243c4047556bee1edfbeee2baad9efa984 /libavfilter/buffersrc.c
parent185d0acdc7a67b7d3d78d4c917334c4c3bf9accd (diff)
downloadffmpeg-67cc7aaa51fcd781ac5920d3c739e28c81cbb0cb.tar.gz
avfilter/buffersrc: Use av_frame_clone() where appropriate
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r--libavfilter/buffersrc.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index ea50713701..453fc0fd5c 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -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