diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-26 02:06:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-26 02:06:40 +0100 |
commit | 3b709fd912749d7731fa954cfb3aedd18d8a666a (patch) | |
tree | a03db8b7a73f30593cae44159cf17042aaf9ce15 /libavformat | |
parent | 50697ac5b2e7151b7e29299a5e36aef17695f9c4 (diff) | |
parent | 9dcf2397219ca796f0fafce2a703770d6fd09920 (diff) | |
download | ffmpeg-3b709fd912749d7731fa954cfb3aedd18d8a666a.tar.gz |
Merge commit '9dcf2397219ca796f0fafce2a703770d6fd09920'
* commit '9dcf2397219ca796f0fafce2a703770d6fd09920':
lavf: Check the return value of strftime
Conflicts:
libavformat/wtvdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 4 | ||||
-rw-r--r-- | libavformat/mxfdec.c | 3 | ||||
-rw-r--r-- | libavformat/wtvdec.c | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index f81b1092f2..bb1858886c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.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); } } diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 9d7f2fffcd..b01dd0c5b7 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -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; } diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 5012890ef3..de3c93158c 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -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; } |