The problem is an integer overflow on "after_init_list_dur" variable.
It happens about 30-40 minutes after starts hls streaming but strongly depends 
on other options like "start_number" or "hls_list_size".
VOD or EVENT hls playlist types are not affected by this bug.

(P.S. I hope this text will be the body and not the subject :) )
---
 libavformat/hlsenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 5f9a200c6e..2e8bcab571 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2195,8 +2195,9 @@ 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 = hls->time * AV_TIME_BASE;
+        after_init_list_dur *= vs->sequence - hls->start_sequence - 
vs->nb_entries;
         hls->recording_time = hls->time * AV_TIME_BASE;
         end_pts = init_list_dur + after_init_list_dur ;
     }
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to