[FFmpeg-devel] [PATCH] lavfi/avf_showspectrum: check RDFT contet init.
Timothy Gu
timothygu99 at gmail.com
Sun Aug 3 21:34:00 CEST 2014
On Sun, Aug 3, 2014 at 11:40 AM, Nicolas George <george at nsup.org> wrote:
> Fix a segfault with large window size.
>
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
> libavfilter/avf_showspectrum.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
> index 7bf3aab..764a000 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 allocate RDFT context. "
> + "Maybe window too high.\n");
> + return AVERROR(EINVAL);
ENOMEM?
> + }
> s->rdft_bits = rdft_bits;
>
> /* RDFT buffers: x2 for each (display) channel buffer.
> --
> 2.0.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list