avformat/movenc: Check return code of ff_iso8601_to_unix_time()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 21 Jun 2015 02:18:08 +0000 (04:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 21 Jun 2015 02:18:08 +0000 (04:18 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/movenc.c

index adde4b2..d4bfed3 100644 (file)
@@ -5247,8 +5247,13 @@ static int mov_write_header(AVFormatContext *s)
         mov_write_mdat_tag(pb, mov);
     }
 
-    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0))
+    if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
         mov->time = ff_iso8601_to_unix_time(t->value);
+        if (mov->time < 0) {
+            av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", t->value);
+            mov->time = 0;
+        }
+    }
     if (mov->time)
         mov->time += 0x7C25B080; // 1970 based -> 1904 based