Commit 23678462 authored by Steven Liu's avatar Steven Liu

avformat/hlsenc: Fix overflow of int for durations compute

Fix ticket: 8037

Reported-by: DusanBrejka
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent 43891ea8
......@@ -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 ;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment