[FFmpeg-cvslog] avformat/mov: Check creation_time for overflow
Michael Niedermayer
git at videolan.org
Tue Apr 4 04:45:58 EEST 2017
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr 1 19:18:36 2017 +0200| [39ee3ddff87a12e108fc4e0d36f756d0ca080472] | committer: Michael Niedermayer
avformat/mov: Check creation_time for overflow
Fixes integer overflow
Fixes: 701640
Found-by: Found-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=39ee3ddff87a12e108fc4e0d36f756d0ca080472
---
libavformat/mov.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4550cf0..90bc249 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);
}
}
More information about the ffmpeg-cvslog
mailing list