diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-12-05 16:08:29 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-12-05 16:15:32 +0100 |
commit | a525b844d9e454e42c762f8030c23bf56d8ec49c (patch) | |
tree | fcf8490c5a656aa53809be707f3798b99cc379ed /libavfilter/af_stereotools.c | |
parent | 66e05f6ff5e5c105bdd7bf3a49234ddac1b592c5 (diff) | |
download | ffmpeg-a525b844d9e454e42c762f8030c23bf56d8ec49c.tar.gz |
avfilter/af_stereotools: check s->length size
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_stereotools.c')
-rw-r--r-- | libavfilter/af_stereotools.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c index 3c796f5b15..00a0dde281 100644 --- a/libavfilter/af_stereotools.c +++ b/libavfilter/af_stereotools.c @@ -110,6 +110,10 @@ static int config_input(AVFilterLink *inlink) StereoToolsContext *s = ctx->priv; s->length = 2 * inlink->sample_rate * 0.05; + if (s->length <= 1 && s->length & 1) { + av_log(ctx, AV_LOG_ERROR, "sample rate is too small\n"); + return AVERROR(EINVAL); + } s->buffer = av_calloc(s->length, sizeof(*s->buffer)); if (!s->buffer) return AVERROR(ENOMEM); |