Steven Liu
02edc0f612
avformat/dashdec: fix integer truncation in calc_max_seg_no()
...
When computing the segment count for a SegmentTimeline entry with
repeat="-1" (indefinite repeat, typical for live streams), the
expression:
length_of_each_segment = pls->timelines[i]->duration /
pls->fragment_timescale;
num = c->period_duration / length_of_each_segment;
performs two successive integer divisions. The first division
truncates toward zero; if the segment duration in timescale ticks
is smaller than the timescale (duration < fragment_timescale),
length_of_each_segment becomes 0, and the second division triggers
a division by zero.
Fix this by using av_rescale(), which computes
period_duration * fragment_timescale / duration
with 64-bit intermediate precision, avoiding both the truncation
and the zero-division risk. If duration is 0 (invalid manifest),
explicitly fall back to first_seq_no instead of crashing.
Signed-off-by: Steven Liu <lq@chinaffmpeg.org >
(cherry picked from commit 0c0dd61b8f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2026-08-02 06:03:03 +02:00
..
2026-07-21 22:59:57 +02:00
2026-05-31 00:39:51 +00:00
2026-05-20 10:59:02 -03:00
2026-04-28 12:29:37 +00:00
2026-06-23 19:15:57 +02:00
2026-05-19 11:36:10 +02:00
2026-04-23 16:46:21 +00:00
2026-05-23 16:07:39 +02:00
2026-06-24 23:31:53 +02:00
2026-06-24 23:31:54 +02:00
2026-06-24 23:31:53 +02:00
2026-06-24 23:31:53 +02:00
2026-05-20 10:10:38 +00:00
2026-05-16 16:53:51 +00:00
2026-06-23 19:15:57 +02:00
2026-05-28 21:46:48 +00:00
2026-06-23 19:15:57 +02:00
2026-06-23 17:15:02 +02:00
2026-05-03 14:40:49 +00:00
2026-04-28 12:29:37 +00:00
2026-05-03 20:32:16 +00:00
2026-04-28 12:29:37 +00:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-05-02 21:40:19 +00:00
2026-05-08 09:34:52 +02:00
2026-08-02 02:47:29 +02:00
2026-07-23 13:58:00 -03:00
2026-05-03 07:30:46 +00:00
2026-07-21 22:59:59 +02:00
2026-06-23 19:15:57 +02:00
2026-08-02 06:03:03 +02:00
2026-06-23 00:04:42 +00:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-06-12 00:46:32 +00:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-05-19 23:12:31 +00:00
2026-04-28 12:29:37 +00:00
2026-05-29 01:49:20 +00:00
2026-05-03 20:03:00 +00:00
2026-06-05 01:14:02 +00:00
2026-07-21 22:59:54 +02:00
2026-04-24 03:23:06 +00:00
2026-08-02 02:47:29 +02:00
2026-08-02 02:47:28 +02:00
2026-06-23 00:04:42 +00:00
2026-06-23 00:04:42 +00:00
2026-06-25 15:50:43 +00:00
2026-05-01 23:58:40 +00:00
2026-08-02 00:13:26 -03:00
2026-05-23 02:41:31 +08:00
2026-05-16 13:55:22 -03:00
2026-05-21 18:05:39 +00:00
2026-05-23 16:07:50 +02:00
2026-04-28 12:29:37 +00:00
2026-07-21 22:59:54 +02:00
2026-07-21 22:59:52 +02:00
2026-05-15 18:19:40 -07:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:13:06 +02:00
2026-06-16 09:18:23 -03:00
2026-06-16 09:18:24 -03:00
2026-04-28 12:29:37 +00:00
2026-07-23 13:58:00 -03:00
2026-07-23 13:58:00 -03:00
2026-06-23 19:15:57 +02:00
2026-05-23 10:03:33 -05:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-07-21 22:59:57 +02:00
2026-05-30 17:37:28 +00:00
2026-06-23 19:15:57 +02:00
2026-06-17 11:11:18 +00:00
2026-05-19 02:33:28 +00:00
2026-04-28 12:29:37 +00:00
2026-05-15 19:30:52 +00:00
2026-06-15 15:13:53 +00:00
2026-06-01 09:53:54 -03:00
2026-08-02 02:47:30 +02:00
2026-06-23 19:15:57 +02:00
2026-07-23 13:58:00 -03:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-05-17 11:16:56 -03:00
2026-05-31 00:39:51 +00:00
2026-06-23 19:15:57 +02:00
2026-07-21 22:59:51 +02:00
2026-06-15 00:25:34 +00:00
2026-05-31 03:43:29 +00:00
2026-06-23 19:15:57 +02:00
2026-05-29 18:23:06 +00:00
2026-06-23 19:15:57 +02:00
2026-05-09 11:28:46 -03:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-05-23 10:16:38 -05:00
2026-05-23 10:16:38 -05:00
2026-06-23 17:15:02 +02:00
2026-04-28 12:29:37 +00:00
2026-05-22 13:27:18 +00:00
2026-05-22 08:20:13 -05:00
2026-06-23 17:15:02 +02:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-05-03 13:26:34 +00:00
2026-06-04 17:48:12 +02:00
2026-06-23 19:13:06 +02:00
2026-06-11 14:06:20 +00:00
2026-06-11 14:06:20 +00:00
2026-05-03 18:22:46 +02:00
2026-06-03 23:36:13 +00:00
2026-05-03 13:18:54 +00:00
2026-07-21 22:59:51 +02:00
2026-05-18 04:00:18 +00:00
2026-05-02 21:16:51 +00:00
2026-05-03 12:42:57 +00:00
2026-05-03 13:19:55 +00:00
2026-05-21 01:09:37 +00:00
2026-06-14 15:32:48 +00:00
2026-05-21 01:15:30 +00:00
2026-04-28 12:29:37 +00:00
2026-08-02 02:47:32 +02:00
2026-06-13 21:31:18 +00:00
2026-04-28 12:29:37 +00:00
2026-05-05 12:54:40 +05:30
2026-06-23 19:15:57 +02:00
2026-05-25 01:15:28 +00:00
2026-07-21 22:59:55 +02:00
2026-07-21 22:59:51 +02:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-05-09 10:46:35 +00:00
2026-06-05 00:43:20 +02:00
2026-04-28 12:29:37 +00:00
2026-07-21 23:00:00 +02:00
2026-08-02 02:47:30 +02:00
2026-05-27 11:39:32 +00:00
2026-06-23 17:15:02 +02:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-07-21 22:59:59 +02:00
2026-07-21 22:59:57 +02:00
2026-06-23 19:15:57 +02:00
2026-06-26 02:43:34 +02:00
2026-05-19 23:11:33 +00:00
2026-05-23 16:09:55 +02:00
2026-07-21 22:59:52 +02:00
2026-05-19 11:36:10 +02:00
2026-07-07 22:27:00 +08:00
2026-06-24 23:31:53 +02:00
2026-05-03 13:26:34 +00:00
2026-04-28 12:29:37 +00:00