From 188a1a17a6ec5aaa6c7618ad99435a7e21c1247c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 23 Nov 2015 14:25:41 +0100 Subject: [PATCH] avformat/movenc-test: Fix integer overflows Signed-off-by: Michael Niedermayer --- libavformat/movenc-test.c | 8 ++++---- tests/ref/fate/movenc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/movenc-test.c b/libavformat/movenc-test.c index a274a5ec4c..d494e41e01 100644 --- a/libavformat/movenc-test.c +++ b/libavformat/movenc-test.c @@ -60,8 +60,8 @@ AVStream *video_st, *audio_st; int64_t audio_dts, video_dts; int bframes; -int duration; -int audio_duration; +int64_t duration; +int64_t audio_duration; int frames; int gop_size; int64_t next_p_pts; @@ -196,9 +196,9 @@ static void init_fps(int bf, int audio_preroll, int fps) frames = 0; gop_size = 30; duration = video_st->time_base.den / fps; - audio_duration = 1024 * audio_st->time_base.den / audio_st->codec->sample_rate; + audio_duration = 1024LL * audio_st->time_base.den / audio_st->codec->sample_rate; if (audio_preroll) - audio_preroll = 2048 * audio_st->time_base.den / audio_st->codec->sample_rate; + audio_preroll = 2048LL * audio_st->time_base.den / audio_st->codec->sample_rate; bframes = bf; video_dts = bframes ? -duration : 0; diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc index abb728f5f4..845ef543fd 100644 --- a/tests/ref/fate/movenc +++ b/tests/ref/fate/movenc @@ -1,7 +1,7 @@ 249e02e3645ea5ca2c74397c62c53314 3269 non-empty-moov 3281ff664e9a06e5a03ec6ea1729696c 3721 non-empty-moov-elst b408a545b1963a5ea82cf37208b66548 3629 non-empty-moov-no-elst -f717c240ddfc036ed8a635b0af55bac2 11459 ismv +a66c786022280c1f69ad7c98c719fa53 4435 ismv 176a315a5385cb2e082d863e0fb22bf1 2891 empty-moov 10eb3fdf6ed1400a1eec50746537159f 3283 empty-moov-no-elst bcd4d6d22f828f1061e13f3af459644f 3115 empty-moov-no-elst-no-adjust