Commit 8e91d965 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg_opt: Check for localtime() failure

Found-by: Daemon404
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 80b5a1e2
......@@ -2438,6 +2438,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment