aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-06-10 21:24:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-07 23:36:27 +0200
commit7a0ea15c7afb8abd823303b9a525cc5e6572f199 (patch)
tree10eaa6dd023b7d790ca911f8d4bece07ac78a64e
parent380a8213b165d1fda419c566241d2641cb6f5c3c (diff)
downloadffmpeg-7a0ea15c7afb8abd823303b9a525cc5e6572f199.tar.gz
avfilter/af_aresample: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503078 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/af_aresample.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index d6bd77beb3..8ff2fe5973 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -195,8 +195,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
av_frame_copy_props(outsamplesref, insamplesref);
outsamplesref->format = outlink->format;
ret = av_channel_layout_copy(&outsamplesref->ch_layout, &outlink->ch_layout);
- if (ret < 0)
+ if (ret < 0) {
+ av_frame_free(&outsamplesref);
+ av_frame_free(&insamplesref);
return ret;
+ }
outsamplesref->sample_rate = outlink->sample_rate;
if(insamplesref->pts != AV_NOPTS_VALUE) {