diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-01-05 19:21:04 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-01-05 19:21:04 +0000 |
commit | 5e2202d6f3ac2f3afd714a62437ca6b24f75c09f (patch) | |
tree | 4c0e62607ee24ccb1f00935a386035b695009c47 /libavformat/mov.c | |
parent | 4af7166fb4a1334fe05f7aa483fcc1cc8560acc1 (diff) | |
download | ffmpeg-5e2202d6f3ac2f3afd714a62437ca6b24f75c09f.tar.gz |
In mov demuxer, check that gmtime returns a valid value, fix crash, issue #2490
Originally committed as revision 26228 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 2ceb21c705..b602221724 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -591,8 +591,11 @@ static void mov_metadata_creation_time(AVMetadata **metadata, time_t time) { 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); } } |