mirror of https://git.ffmpeg.org/ffmpeg.git
ffmpeg_opt: Check for localtime() failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e91d9652e
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d54ca4167c
commit
22349b9f7d
|
@ -2321,6 +2321,9 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
|
||||||
time_t today2 = time(NULL);
|
time_t today2 = time(NULL);
|
||||||
struct tm *today = localtime(&today2);
|
struct tm *today = localtime(&today2);
|
||||||
|
|
||||||
|
if (!today)
|
||||||
|
return AVERROR(errno);
|
||||||
|
|
||||||
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
|
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
|
||||||
today->tm_sec);
|
today->tm_sec);
|
||||||
return opt_vstats_file(NULL, opt, filename);
|
return opt_vstats_file(NULL, opt, filename);
|
||||||
|
|
Loading…
Reference in New Issue