Skip to content

Commit

Permalink
ffmpeg_opt: Check for localtime() failure
Browse files Browse the repository at this point in the history
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Jun 12, 2015
1 parent 80b5a1e commit 8e91d96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ffmpeg_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8e91d96

Please sign in to comment.