Imported Debian version 2.5.0~trusty1.1
[deb_ffmpeg.git] / ffmpeg / libavutil / parseutils.c
index ba4b4e1b722f8c8ace520a3317cbdef68c4ae58d..4708699ccc9b4ee8ce533e7e35a71f7c8c0b8153 100644 (file)
@@ -29,6 +29,7 @@
 #include "eval.h"
 #include "log.h"
 #include "random_seed.h"
+#include "time_internal.h"
 #include "parseutils.h"
 
 #ifdef TEST
@@ -552,7 +553,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
     const char *p, *q;
     int64_t t;
     time_t now;
-    struct tm dt = { 0 };
+    struct tm dt = { 0 }, tmbuf;
     int today = 0, negative = 0, microseconds = 0;
     int i;
     static const char * const date_fmt[] = {
@@ -647,7 +648,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
         int is_utc = *q == 'Z' || *q == 'z';
         q += is_utc;
         if (today) { /* fill in today's date */
-            struct tm dt2 = is_utc ? *gmtime(&now) : *localtime(&now);
+            struct tm dt2 = is_utc ? *gmtime_r(&now, &tmbuf) : *localtime_r(&now, &tmbuf);
             dt2.tm_hour = dt.tm_hour;
             dt2.tm_min  = dt.tm_min;
             dt2.tm_sec  = dt.tm_sec;