summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2017-04-01 19:18:36 +0200
committerMichael Niedermayer <[email protected]>2017-04-08 22:31:05 +0200
commitf4400a92f58fbe19b14eb675c241f7df310758fd (patch)
tree4b0377922670aafad330157f9545db271c3e3aec
parenta430ba99251e34c5f4965955f506ffda21b8d34a (diff)
avformat/mov: Check creation_time for overflow
Fixes integer overflow Fixes: 701640 Found-by: Found-by: Thomas Guilbert <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 39ee3ddff87a12e108fc4e0d36f756d0ca080472) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/mov.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1d30a73a44..f2296f8917 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1186,6 +1186,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);
}
}