1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

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>
(cherry picked from commit 7a0ea15c7afb8abd823303b9a525cc5e6572f199)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-10 21:24:47 +02:00
parent 4d00378da8
commit ca5ffb7f46
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -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) {