[FFmpeg-cvslog] ffmpeg_opt: Check for localtime() failure
Michael Niedermayer
git at videolan.org
Mon Jul 20 10:48:17 CEST 2015
ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 12 15:36:20 2015 +0200| [1c5d25f2c00849a2120a00c2d8c86c07386b93c5] | committer: Michael Niedermayer
ffmpeg_opt: Check for localtime() failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1c5d25f2c00849a2120a00c2d8c86c07386b93c5
---
ffmpeg_opt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index faa4616..c620045 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -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);
More information about the ffmpeg-cvslog
mailing list