diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-04-01 20:18:36 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-14 13:20:15 +0300 |
commit | 502313dd5079dae4d569409311b4557f7d5b5fb3 (patch) | |
tree | af9dd80775acdf87ba89302fc6b9a1d50bc1eeee /libavformat/mov.c | |
parent | 0a6598536cbc4daf71f63a28a7b6dce08be1f122 (diff) |
avformat/mov: Check creation_time for overflow
Fixes integer overflow
Fixes: 701640
Found-by: Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39ee3ddff87a12e108fc4e0d36f756d0ca080472)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 12811dbf78..24a76a0daa 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1182,6 +1182,12 @@ static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time) if (time) { if(time >= 2082844800) time -= 2082844800; /* seconds between 1904-01-01 and Epoch */ + + if ((int64_t)(time * 1000000ULL) / 1000000 != time) { + av_log(NULL, AV_LOG_DEBUG, "creation_time is not representable\n"); + return; + } + avpriv_dict_set_timestamp(metadata, "creation_time", time * 1000000); } } |