From 01d9a84ef58c2d0d89958b18420483b058ac9dd1 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 17 May 2023 09:02:11 +0200 Subject: [PATCH] avfilter/avf_showspectrum: check for allocation error --- libavfilter/avf_showspectrum.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index 4ce964706f..6c3d0e8c2b 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -1292,6 +1292,8 @@ static int config_output(AVFilterLink *outlink) av_realloc_f(s->combine_buffer, s->w * 4, sizeof(*s->combine_buffer)); } + if (!s->combine_buffer) + return AVERROR(ENOMEM); av_log(ctx, AV_LOG_VERBOSE, "s:%dx%d FFT window size:%d\n", s->w, s->h, s->win_size);