[FFmpeg-cvslog] r26228 - trunk/libavformat/mov.c

bcoudurier subversion
Wed Jan 5 20:21:04 CET 2011


Author: bcoudurier
Date: Wed Jan  5 20:21:04 2011
New Revision: 26228

Log:
In mov demuxer, check that gmtime returns a valid value, fix crash, issue #2490

Modified:
   trunk/libavformat/mov.c

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	Wed Jan  5 20:14:44 2011	(r26227)
+++ trunk/libavformat/mov.c	Wed Jan  5 20:21:04 2011	(r26228)
@@ -591,8 +591,11 @@ static void mov_metadata_creation_time(A
 {
     char buffer[32];
     if (time) {
+        struct tm *ptm;
         time -= 2082844800;  /* seconds between 1904-01-01 and Epoch */
-        strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", gmtime(&time));
+        ptm = gmtime(&time);
+        if (!ptm) return;
+        strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
         av_metadata_set2(metadata, "creation_time", buffer, 0);
     }
 }



More information about the ffmpeg-cvslog mailing list