[FFmpeg-cvslog] avfilter/af_stereotools: check s->length size
Paul B Mahol
git at videolan.org
Sat Dec 5 16:15:42 CET 2015
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Dec 5 16:08:29 2015 +0100| [a525b844d9e454e42c762f8030c23bf56d8ec49c] | committer: Paul B Mahol
avfilter/af_stereotools: check s->length size
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a525b844d9e454e42c762f8030c23bf56d8ec49c
---
libavfilter/af_stereotools.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 3c796f5..00a0dde 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);
More information about the ffmpeg-cvslog
mailing list