diff options
author | James Almer <jamrial@gmail.com> | 2021-04-23 00:26:09 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-04-25 09:22:09 -0300 |
commit | bc2726969400e1e57d25d1042f860eb2cbdf7465 (patch) | |
tree | 8b607c579e6b97c67d9b96db08702bc98f56e89a | |
parent | ff946633a30e15415974c3f0ec7751c04eb91701 (diff) | |
download | ffmpeg-bc2726969400e1e57d25d1042f860eb2cbdf7465.tar.gz |
avfilter/af_adelay: make per channel delay argument an int64_t
Should fix ticket #9196
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavfilter/af_adelay.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c index 6ac81c2a3e..81ff7947f5 100644 --- a/libavfilter/af_adelay.c +++ b/libavfilter/af_adelay.c @@ -28,9 +28,9 @@ #include "internal.h" typedef struct ChanDelay { - int delay; - unsigned delay_index; - unsigned index; + int64_t delay; + size_t delay_index; + size_t index; uint8_t *samples; } ChanDelay; @@ -152,7 +152,7 @@ static int config_input(AVFilterLink *inlink) p = NULL; - ret = av_sscanf(arg, "%d%c", &d->delay, &type); + ret = av_sscanf(arg, "%"SCNd64"%c", &d->delay, &type); if (ret != 2 || type != 'S') { div = type == 's' ? 1.0 : 1000.0; if (av_sscanf(arg, "%f", &delay) != 1) { @@ -194,6 +194,11 @@ static int config_input(AVFilterLink *inlink) if (!d->delay) continue; + if (d->delay > SIZE_MAX) { + av_log(ctx, AV_LOG_ERROR, "Requested delay is too big.\n"); + return AVERROR(EINVAL); + } + d->samples = av_malloc_array(d->delay, s->block_align); if (!d->samples) return AVERROR(ENOMEM); |