History

avfilter/af_adelay: Check sscanf() return value

Limin Wang committed 6 years ago

Commit f441fad1 parent ee5d6d21 file · +4 −1Browse files

Unified · Split

libavfilter/af_adelay.c+4−1
@@ -155,7 +155,10 @@ static int config_input(AVFilterLink *inlink) · 154 unmodified lines
155 ret = av_sscanf(arg, "%d%c", &d->delay, &type);155 ret = av_sscanf(arg, "%d%c", &d->delay, &type);
156 if (ret != 2 || type != 'S') {156 if (ret != 2 || type != 'S') {
157 div = type == 's' ? 1.0 : 1000.0;157 div = type == 's' ? 1.0 : 1000.0;
158 av_sscanf(arg, "%f", &delay);158 if (av_sscanf(arg, "%f", &delay) != 1) {
159 av_log(ctx, AV_LOG_ERROR, "Invalid syntax for delay.\n");
160 return AVERROR(EINVAL);
161 }
159 d->delay = delay * inlink->sample_rate / div;162 d->delay = delay * inlink->sample_rate / div;
160 }163 }
161 164

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t