In config_input(), fir_to_phase() allocates memory in h[longer]. But if av_calloc() to s->coeffs failed, memory in h[longer] would leak. Add av_free(h[longer]) in !s->coeffs path.
Signed-off-by: Lidong Yan <502024330...@smail.nju.edu.cn> --- libavfilter/asrc_sinc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c index 6ff3303316..198c322665 100644 --- a/libavfilter/asrc_sinc.c +++ b/libavfilter/asrc_sinc.c @@ -370,8 +370,10 @@ static int config_output(AVFilterLink *outlink) s->n = 1 << (av_log2(n) + 1); s->rdft_len = 1 << av_log2(n); s->coeffs = av_calloc(s->n, sizeof(*s->coeffs)); - if (!s->coeffs) + if (!s->coeffs) { + av_free(h[longer]); return AVERROR(ENOMEM); + } for (i = 0; i < n; i++) s->coeffs[i] = h[longer][i]; -- 2.50.0-rc1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".