[FFmpeg-cvslog] movenc-test: Fix integer overflows
Michael Niedermayer
git at videolan.org
Sun Nov 29 16:09:50 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Nov 23 14:25:41 2015 +0100| [5b70fb8fee4af3b13f29a2dc7222fd3c9782f79b] | committer: Martin Storsjö
movenc-test: Fix integer overflows
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b70fb8fee4af3b13f29a2dc7222fd3c9782f79b
---
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 0a1384e..0c40b3a 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 b1196a2..2955233 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -1,7 +1,7 @@
4e7e78793cdda3c9ed28fbf47df39c43 2449 non-empty-moov
5b825dc829f35c9d5b76834c378276d7 2897 non-empty-moov-elst
0fd659671dec7d05cfa533a4579b1d6d 2817 non-empty-moov-no-elst
-890ad73874bff5aefbd549bc75a15b8e 9139 ismv
+845fdc9226a0e3f14e5f92219ce8f570 3871 ismv
aa6f42a0546a27f7047f1cff812a552f 2327 empty-moov
9a439649d13cdcddf6179234fe3d8a8e 2727 empty-moov-no-elst
2451cb44e678845ed26e014e1affe5e8 2559 empty-moov-no-elst-no-adjust
More information about the ffmpeg-cvslog
mailing list