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) ...@@ -194,12 +194,16 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->combine_buffer); av_freep(&s->combine_buffer);
av_rdft_end(s->rdft); av_rdft_end(s->rdft);
for (i = 0; i < s->nb_display_channels; i++) if (s->rdft_data) {
av_freep(&s->rdft_data[i]); for (i = 0; i < s->nb_display_channels; i++)
av_freep(&s->rdft_data[i]);
}
av_freep(&s->rdft_data); av_freep(&s->rdft_data);
av_freep(&s->window_func_lut); av_freep(&s->window_func_lut);
for (i = 0; i < s->nb_display_channels; i++) if (s->magnitudes) {
av_freep(&s->magnitudes[i]); for (i = 0; i < s->nb_display_channels; i++)
av_freep(&s->magnitudes[i]);
}
av_freep(&s->magnitudes); av_freep(&s->magnitudes);
av_frame_free(&s->outpicref); av_frame_free(&s->outpicref);
av_audio_fifo_free(s->fifo); 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