summaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2023-09-07 12:02:26 +0200
committerAndreas Rheinhardt <[email protected]>2023-09-10 21:22:30 +0200
commitcfa47fd3310aa64d5c48e855bfcaf26d170bcbc1 (patch)
tree81b7df5f60d0808297dafc4229dac9def914749e /libavutil/hwcontext.c
parent0487786ffe272af2954ed4d81e827f7ad9e76895 (diff)
all: Use av_frame_replace() where appropriate
Signed-off-by: Andreas Rheinhardt <[email protected]>
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 3396598269..3650d4653a 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
return AVERROR(EINVAL);
}
hwmap = (HWMapDescriptor*)src->buf[0]->data;
- av_frame_unref(dst);
- return av_frame_ref(dst, hwmap->source);
+ return av_frame_replace(dst, hwmap->source);
}
}
@@ -950,6 +949,5 @@ fail:
int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src)
{
HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data;
- av_frame_unref(hwmap->source);
- return av_frame_ref(hwmap->source, src);
+ return av_frame_replace(hwmap->source, src);
}