ffmpeg_opt: Check the return code from strftime()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 26 Oct 2014 14:52:12 +0000 (15:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 26 Oct 2014 16:07:29 +0000 (17:07 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_opt.c

index 7a5eaa5..27e0890 100644 (file)
@@ -509,7 +509,8 @@ static int opt_recording_timestamp(void *optctx, const char *opt, const char *ar
     char buf[128];
     int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6;
     struct tm time = *gmtime((time_t*)&recording_timestamp);
     char buf[128];
     int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6;
     struct tm time = *gmtime((time_t*)&recording_timestamp);
-    strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time);
+    if (!strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time))
+        return -1;
     parse_option(o, "metadata", buf, options);
 
     av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata "
     parse_option(o, "metadata", buf, options);
 
     av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata "