[FFmpeg-cvslog] avfilter/avf_showspectrum: check for allocation error

Paul B Mahol git at videolan.org
Thu May 18 13:09:09 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed May 17 09:02:11 2023 +0200| [01d9a84ef58c2d0d89958b18420483b058ac9dd1] | committer: Paul B Mahol

avfilter/avf_showspectrum: check for allocation error

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01d9a84ef58c2d0d89958b18420483b058ac9dd1
---

 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);



More information about the ffmpeg-cvslog mailing list