mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
ffmpeg_opt: Check for localtime() failure
Found-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
35e46e74bc
commit
1c5d25f2c0
@ -2379,6 +2379,9 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
|
||||
time_t today2 = time(NULL);
|
||||
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,
|
||||
today->tm_sec);
|
||||
return opt_vstats_file(NULL, opt, filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user