Skip to content
Snippets Groups Projects
Commit a525b844 authored by Paul B Mahol's avatar Paul B Mahol
Browse files

avfilter/af_stereotools: check s->length size


Signed-off-by: default avatarPaul B Mahol <onemda@gmail.com>
parent 66e05f6f
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,10 @@ static int config_input(AVFilterLink *inlink) ...@@ -110,6 +110,10 @@ static int config_input(AVFilterLink *inlink)
StereoToolsContext *s = ctx->priv; StereoToolsContext *s = ctx->priv;
s->length = 2 * inlink->sample_rate * 0.05; 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)); s->buffer = av_calloc(s->length, sizeof(*s->buffer));
if (!s->buffer) if (!s->buffer)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment