[FFmpeg-cvslog] lavfi/avf_showspectrum: check RDFT context init.

Nicolas George git at videolan.org
Thu Aug 14 19:53:45 CEST 2014


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Sun Aug  3 20:39:59 2014 +0200| [638eec2ac34b7f65a8e84203ea4292440bc8fe50] | committer: Nicolas George

lavfi/avf_showspectrum: check RDFT context init.

Fix a segfault with large window size.

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

 libavfilter/avf_showspectrum.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 9130f6f..bd4d818 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -177,6 +177,11 @@ static int config_output(AVFilterLink *outlink)
 
         av_rdft_end(s->rdft);
         s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
+        if (!s->rdft) {
+            av_log(ctx, AV_LOG_ERROR, "Unable to create RDFT context. "
+                   "The window size might be too high.\n");
+            return AVERROR(EINVAL);
+        }
         s->rdft_bits = rdft_bits;
 
         /* RDFT buffers: x2 for each (display) channel buffer.



More information about the ffmpeg-cvslog mailing list