This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 25c2c2338780344df7a8f0c97c81e86513a530f2 Author: Ayoub Nabil Boubagrat <[email protected]> AuthorDate: Thu Aug 27 20:16:59 2026 +0200 Commit: michaelni <[email protected]> CommitDate: Mon Aug 31 13:42:52 2026 +0000 avfilter/adelay: reject delays outside int64 range converting a non-finite or too large sample count to int64_t is undefined. validate the value before conversion. Signed-off-by: Ayoub Nabil Boubagrat <[email protected]> --- libavfilter/af_adelay.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c index 4606e29c45..0ce65e7b9b 100644 --- a/libavfilter/af_adelay.c +++ b/libavfilter/af_adelay.c @@ -157,7 +157,7 @@ CHANGE_DELAY(flt, float, 0) CHANGE_DELAY(dbl, double, 0) static int parse_delays(char *p, char **saveptr, int64_t *result, AVFilterContext *ctx, int sample_rate) { - float delay, div; + double delay, div; char *arg; char suffix; @@ -166,12 +166,19 @@ static int parse_delays(char *p, char **saveptr, int64_t *result, AVFilterContex suffix = arg[strlen(arg) - 1]; if (suffix != 'S') { + double delay_samples; + div = suffix == 's' ? 1.0 : 1000.0; - if (av_sscanf(arg, "%f", &delay) != 1) { + if (av_sscanf(arg, "%lf", &delay) != 1) { av_log(ctx, AV_LOG_ERROR, "Invalid syntax for delay.\n"); return AVERROR(EINVAL); } - *result = delay * sample_rate / div; + delay_samples = delay * sample_rate / div; + if (!isfinite(delay_samples) || delay_samples < -0x1p63 || delay_samples >= 0x1p63) { + av_log(ctx, AV_LOG_ERROR, "Delay is out of range.\n"); + return AVERROR(EINVAL); + } + *result = delay_samples; } else { char type; -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
