mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avfilter/aiir: reject non-finite parameters
Signed-off-by: Ayoub Nabil Boubagrat <237098474+ayoubnabil@users.noreply.github.com>
This commit is contained in:
committed by
michaelni
parent
0ba7514f99
commit
1d49dc80a9
@@ -377,7 +377,7 @@ static int read_gains(AVFilterContext *ctx, char *item_str, int nb_items)
|
||||
}
|
||||
|
||||
p = NULL;
|
||||
if (av_sscanf(arg, "%lf", &s->iir[i].g) != 1) {
|
||||
if (av_sscanf(arg, "%lf", &s->iir[i].g) != 1 || !isfinite(s->iir[i].g)) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Invalid gains supplied: %s\n", arg);
|
||||
av_freep(&old_str);
|
||||
return AVERROR(EINVAL);
|
||||
@@ -404,7 +404,7 @@ static int read_tf_coefficients(AVFilterContext *ctx, char *item_str, int nb_ite
|
||||
break;
|
||||
|
||||
p = NULL;
|
||||
if (av_sscanf(arg, "%lf", &dst[i]) != 1) {
|
||||
if (av_sscanf(arg, "%lf", &dst[i]) != 1 || !isfinite(dst[i])) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Invalid coefficients supplied: %s\n", arg);
|
||||
av_freep(&old_str);
|
||||
return AVERROR(EINVAL);
|
||||
@@ -429,7 +429,8 @@ static int read_zp_coefficients(AVFilterContext *ctx, char *item_str, int nb_ite
|
||||
break;
|
||||
|
||||
p = NULL;
|
||||
if (av_sscanf(arg, format, &dst[i*2], &dst[i*2+1]) != 2) {
|
||||
if (av_sscanf(arg, format, &dst[i*2], &dst[i*2+1]) != 2 ||
|
||||
!isfinite(dst[i*2]) || !isfinite(dst[i*2+1])) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Invalid coefficients supplied: %s\n", arg);
|
||||
av_freep(&old_str);
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
Reference in New Issue
Block a user