aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-06-10 15:18:07 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-07 23:36:29 +0200
commit62d4414d54f57612ac444643a92de7d10455b6c6 (patch)
tree0e8d2c4f04eb7dc9453912426b932ee9771b8eae
parenta5c815f937a80d7689bc0f2deb3ac968f2630176 (diff)
downloadffmpeg-62d4414d54f57612ac444643a92de7d10455b6c6.tar.gz
avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure
Fixes: CID1503088 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/af_amerge.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index 493c852138..67c87d1d9e 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -246,8 +246,11 @@ static int try_push_frame(AVFilterContext *ctx, int nb_samples)
av_make_q(1, outlink->sample_rate),
outlink->time_base);
- if ((ret = av_channel_layout_copy(&outbuf->ch_layout, &outlink->ch_layout)) < 0)
+ if ((ret = av_channel_layout_copy(&outbuf->ch_layout, &outlink->ch_layout)) < 0) {
+ free_frames(s->nb_inputs, inbuf);
+ av_frame_free(&outbuf);
return ret;
+ }
while (nb_samples) {
/* Unroll the most common sample formats: speed +~350% for the loop,