Commit d35c029c authored by Paul B Mahol's avatar Paul B Mahol

avfilter/avf_showspectrum: fix null pointer dereference if allocation fails

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 9b06e7be
......@@ -194,12 +194,16 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->combine_buffer);
av_rdft_end(s->rdft);
if (s->rdft_data) {
for (i = 0; i < s->nb_display_channels; i++)
av_freep(&s->rdft_data[i]);
}
av_freep(&s->rdft_data);
av_freep(&s->window_func_lut);
if (s->magnitudes) {
for (i = 0; i < s->nb_display_channels; i++)
av_freep(&s->magnitudes[i]);
}
av_freep(&s->magnitudes);
av_frame_free(&s->outpicref);
av_audio_fifo_free(s->fifo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment