In mxf muxer, check the return value of gmtime, fix #2494
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Fri, 14 Jan 2011 22:36:23 +0000 (22:36 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Fri, 14 Jan 2011 22:36:23 +0000 (22:36 +0000)
Originally committed as revision 26343 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mxfenc.c

index d589939..c53849a 100644 (file)
@@ -1379,6 +1379,8 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st,
 static uint64_t mxf_parse_timestamp(time_t timestamp)
 {
     struct tm *time = gmtime(&timestamp);
+    if (!time)
+        return 0;
     return (uint64_t)(time->tm_year+1900) << 48 |
            (uint64_t)(time->tm_mon+1)     << 40 |
            (uint64_t) time->tm_mday       << 32 |