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>
(cherry picked from commit 62d4414d54)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.0
Michael Niedermayer 7 months ago
parent acd5523b7a
commit 9ca0577c5e
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 5
      libavfilter/af_amerge.c

@ -245,8 +245,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,

Loading…
Cancel
Save