1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/af_acrossover: Check sscanf() return value

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang 2020-03-29 08:08:04 +08:00 committed by Paul B Mahol
parent 24db9372eb
commit 403bee30a5

View File

@ -99,7 +99,10 @@ static av_cold int init(AVFilterContext *ctx)
p = NULL; p = NULL;
av_sscanf(arg, "%f", &freq); if (av_sscanf(arg, "%f", &freq) != 1) {
av_log(ctx, AV_LOG_ERROR, "Invalid syntax for frequency[%d].\n", i);
return AVERROR(EINVAL);
}
if (freq <= 0) { if (freq <= 0) {
av_log(ctx, AV_LOG_ERROR, "Frequency %f must be positive number.\n", freq); av_log(ctx, AV_LOG_ERROR, "Frequency %f must be positive number.\n", freq);
return AVERROR(EINVAL); return AVERROR(EINVAL);