aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-03 02:49:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-19 03:51:38 +0100
commitc23902b6717b9740a73d73699885bb758f6e839b (patch)
tree9afa54501cd210114724d0d084b30f5c8362b329 /libavformat
parentba1715f52a96edf74b0bc3182f4db2618f1eec8f (diff)
downloadffmpeg-c23902b6717b9740a73d73699885bb758f6e839b.tar.gz
avformat/dump: Fix integer overflow in aspect ratio calculation
Fixes: unknown_unknown_19e_414_cov_764838672_bellhamlam.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d1bdaf3fb2c45020f72a378bb64eab1bf136581c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56b37ff7d8..df102e6c65 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -371,8 +371,8 @@ static void dump_stream_format(AVFormatContext *ic, int i,
av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
AVRational display_aspect_ratio;
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
- st->codec->width * st->sample_aspect_ratio.num,
- st->codec->height * st->sample_aspect_ratio.den,
+ st->codec->width * (int64_t)st->sample_aspect_ratio.num,
+ st->codec->height * (int64_t)st->sample_aspect_ratio.den,
1024 * 1024);
av_log(NULL, AV_LOG_INFO, ", SAR %d:%d DAR %d:%d",
st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,