diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-12 15:36:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-18 22:09:01 +0200 |
commit | 965f96c5ed445c639377c977934ee3aecf505ca8 (patch) | |
tree | 89db3f2ea0d4732ad88821a144c210a6f980141a | |
parent | 3b6aeb148b1da3b21a5a569f2697c7e49901d031 (diff) | |
download | ffmpeg-965f96c5ed445c639377c977934ee3aecf505ca8.tar.gz |
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>
-rw-r--r-- | ffmpeg_opt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 1c5794ce09..79cb5caa34 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -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); |