Merge commit '9dcf2397219ca796f0fafce2a703770d6fd09920'

* commit '9dcf2397219ca796f0fafce2a703770d6fd09920':
  lavf: Check the return value of strftime

Conflicts:
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/90/head
Michael Niedermayer 10 years ago
commit 3b709fd912
  1. 4
      libavformat/mov.c
  2. 3
      libavformat/mxfdec.c
  3. 9
      libavformat/wtvdec.c

@ -816,8 +816,8 @@ static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time)
timet = time;
ptm = gmtime(&timet);
if (!ptm) return;
strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
av_dict_set(metadata, "creation_time", buffer, 0);
if (strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm))
av_dict_set(metadata, "creation_time", buffer, 0);
}
}

@ -1877,7 +1877,8 @@ static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
*str = av_mallocz(32);
if (!*str)
return AVERROR(ENOMEM);
strftime(*str, 32, "%Y-%m-%d %H:%M:%S", &time);
if (!strftime(*str, 32, "%Y-%m-%d %H:%M:%S", &time))
str[0] = '\0';
return 0;
}

@ -389,7 +389,8 @@ static int filetime_to_iso8601(char *buf, int buf_size, int64_t value)
struct tm *tm = gmtime(&t);
if (!tm)
return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
return -1;
return 0;
}
@ -403,7 +404,8 @@ static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
struct tm *tm = gmtime(&t);
if (!tm)
return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
return -1;
return 0;
}
@ -417,7 +419,8 @@ static int oledate_to_iso8601(char *buf, int buf_size, int64_t value)
struct tm *tm= gmtime(&t);
if (!tm)
return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
return -1;
return 0;
}

Loading…
Cancel
Save