mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
libavfilter/af_firequalizer: Add check for av_malloc_array()
Add check for the return value of av_malloc_array() to avoid potential NULL pointer dereference. Fixes:d3be186ed1("avfilter/firequalizer: add dumpfile and dumpscale option") Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commita25462482c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
346ac063df
commit
0e8ccde9e5
@@ -808,6 +808,8 @@ static int config_input(AVFilterLink *inlink)
|
||||
if ((ret = av_tx_init(&s->analysis_rdft, &s->analysis_rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << rdft_bits, &scale, 0)) < 0)
|
||||
return ret;
|
||||
s->dump_buf = av_malloc_array(s->analysis_rdft_len + 2, sizeof(*s->dump_buf));
|
||||
if (!s->dump_buf)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
s->analysis_buf = av_malloc_array((s->analysis_rdft_len + 2), sizeof(*s->analysis_buf));
|
||||
|
||||
Reference in New Issue
Block a user