aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2019-07-29 19:48:06 +0800
committerSteven Liu <lq@chinaffmpeg.org>2019-07-29 19:48:06 +0800
commit23678462c0a316772d112ca363a4ffdf7d4b4236 (patch)
tree690f325b5e4d55c5ab45ac436cd9bf5bd067afd2 /libavformat
parent43891ea8ab286a08e731ebac78123c4f1b1d35ca (diff)
downloadffmpeg-23678462c0a316772d112ca363a4ffdf7d4b4236.tar.gz
avformat/hlsenc: Fix overflow of int for durations compute
Fix ticket: 8037 Reported-by: DusanBrejka Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 2ade6723f9..51310fb528 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2301,8 +2301,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
if (vs->sequence - vs->nb_entries > hls->start_sequence && hls->init_time > 0) {
/* reset end_pts, hls->recording_time at end of the init hls list */
- int init_list_dur = hls->init_time * vs->nb_entries * AV_TIME_BASE;
- int after_init_list_dur = (vs->sequence - hls->start_sequence - vs->nb_entries ) * (hls->time * AV_TIME_BASE);
+ int64_t init_list_dur = hls->init_time * vs->nb_entries * AV_TIME_BASE;
+ int64_t after_init_list_dur = (vs->sequence - hls->start_sequence - vs->nb_entries ) * (hls->time * AV_TIME_BASE);
hls->recording_time = hls->time * AV_TIME_BASE;
end_pts = init_list_dur + after_init_list_dur ;
}