summaryrefslogtreecommitdiff
path: root/libavfilter/vf_paletteuse.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 12:02:26 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-10 21:22:30 +0200
commitcfa47fd3310aa64d5c48e855bfcaf26d170bcbc1 (patch)
tree81b7df5f60d0808297dafc4229dac9def914749e /libavfilter/vf_paletteuse.c
parent0487786ffe272af2954ed4d81e827f7ad9e76895 (diff)
all: Use av_frame_replace() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_paletteuse.c')
-rw-r--r--libavfilter/vf_paletteuse.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index 79d8fb2e51..bc767c508c 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -781,9 +781,8 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, AVFrame **outf)
set_processing_window(s->diff_mode, s->last_in, in,
s->last_out, out, &x, &y, &w, &h);
- av_frame_unref(s->last_in);
av_frame_unref(s->last_out);
- if ((ret = av_frame_ref(s->last_in, in)) < 0 ||
+ if ((ret = av_frame_replace(s->last_in, in)) < 0 ||
(ret = av_frame_ref(s->last_out, out)) < 0 ||
(ret = ff_inlink_make_frame_writable(inlink, &s->last_in)) < 0) {
av_frame_free(&out);