Steven Liu
7e1cec8e0a
avformat/dashdec: fix unsigned integer overflow in segment number calculation
...
fix issue: issues/23238
Several time-related fields in DASHContext were declared as uint64_t,
causing the arithmetic in calc_cur_seg_no(), calc_min_seg_no(), and
calc_max_seg_no() to be performed with unsigned semantics.
The expression:
(get_current_time_in_sec() - availability_start_time) * fragment_timescale
is uint64_t throughout. When presentationTimeOffset is large (e.g. an
absolute epoch-based timestamp common in DVB-DASH live streams), the
subsequent subtraction:
uint64_t_result - presentation_timeoffset
wraps around to a value near 2^64, because the elapsed wall-clock time
in timescale ticks is far smaller than the absolute presentation time
offset. The enormous quotient ends up truncated to int32_t when passed
to ff_dash_fill_tmpl_params(), producing a negative $Number$ value in
the segment URL and causing repeated HTTP 403 errors.
Fix this by changing the affected fields and the two helper functions
(get_current_time_in_sec, get_utc_date_time_insec) from uint64_t to
int64_t. All values involved are well within the int64_t range (Unix
timestamps in seconds and ISO 8601 durations), and the arithmetic
naturally needs signed semantics because intermediate sub-expressions
like (elapsed - time_shift_buffer_depth) can be negative at stream
start.
Signed-off-by: Steven Liu <lq@chinaffmpeg.org >
2026-06-15 02:22:05 +00:00
..
2026-06-11 14:06:20 +00: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-03 14:32:19 +00:00
2026-05-19 11:36:10 +02:00
2026-03-10 13:52:18 +01:00
2026-04-23 16:46:21 +00:00
2026-05-23 16:07:39 +02:00
2026-03-10 13:52:18 +01:00
2026-05-20 10:10:38 +00:00
2026-05-16 16:53:51 +00:00
2026-03-13 21:29:14 +00:00
2026-05-28 21:46:48 +00:00
2026-06-04 17:03:05 +00:00
2026-05-31 03:43:29 +00: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-03-10 13:52:18 +01:00
2026-04-28 12:29:37 +00:00
2026-03-10 13:52:18 +01:00
2026-05-02 21:40:19 +00:00
2026-05-08 09:34:52 +02:00
2026-02-26 11:40:16 +08:00
2026-03-19 11:59:59 -03:00
2026-05-03 07:30:46 +00:00
2026-06-15 02:22:05 +00:00
2026-05-29 03:25:53 +00:00
2026-05-31 03:43:29 +00:00
2026-06-12 00:46:32 +00:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-04-02 19:06:59 +00:00
2026-04-02 19:06:59 +00:00
2026-06-12 15:10:12 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-06-04 17:48:12 +02:00
2026-03-04 10:40:12 +00: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-03-14 20:50:21 -03:00
2026-04-24 03:23:06 +00:00
2026-04-24 03:23:06 +00:00
2026-05-25 00:10:18 +00:00
2026-06-12 01:57:06 +00:00
2026-06-12 16:47:05 +00:00
2026-05-01 23:58:40 +00:00
2026-03-13 04:39:35 +01:00
2026-06-05 01:11:58 +00:00
2026-02-27 11:01:25 -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-06-01 22:56:47 +00:00
2026-05-15 18:19:40 -07:00
2026-05-15 18:19:40 -07:00
2026-06-10 11:59:35 +00:00
2026-06-02 20:55:14 +00:00
2026-04-28 12:29:37 +00:00
2026-03-10 13:52:18 +01:00
2026-03-20 10:47:13 +08:00
2026-03-19 11:59:58 -03:00
2026-03-14 20:50:21 -03: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-06-04 17:48:12 +02:00
2026-05-30 17:37:28 +00:00
2026-06-07 02:56:44 +00:00
2026-05-30 17:37:28 +00:00
2026-05-19 02:33:28 +00:00
2026-04-02 19:06:59 +00:00
2026-04-28 12:29:37 +00:00
2026-05-15 19:30:52 +00:00
2026-06-01 09:53:54 -03:00
2026-06-01 09:53:54 -03:00
2026-06-12 02:00:36 +00:00
2026-06-10 18:14:42 +00:00
2026-05-17 11:16:56 -03: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-03-10 13:52:18 +01:00
2026-05-31 00:39:51 +00:00
2026-06-15 00:25:34 +00:00
2026-05-31 03:43:29 +00:00
2026-03-29 11:06:36 +00:00
2026-05-22 08:20:13 -05:00
2026-05-29 18:23:06 +00:00
2026-04-28 12:29:37 +00:00
2026-05-09 11:28:46 -03:00
2026-04-28 12:29:37 +00: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-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01: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-05-31 03:43:29 +00:00
2026-05-03 13:26:34 +00:00
2026-04-20 12:54:31 +02:00
2026-06-04 17:48:12 +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-03-10 13:52:18 +01:00
2026-03-21 00:29:04 +00:00
2026-06-03 23:36:13 +00:00
2026-05-03 13:18:54 +00: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-04-13 20:19:37 +00:00
2026-03-10 13:52:18 +01:00
2026-03-23 19:49:25 +00:00
2026-05-21 01:09:37 +00:00
2026-06-14 15:32:48 +00:00
2026-03-10 13:52:18 +01:00
2026-05-21 01:15:30 +00:00
2026-04-28 12:29:37 +00:00
2026-05-03 12:43:05 +00:00
2026-06-13 21:31:18 +00:00
2026-04-28 12:29:37 +00:00
2026-04-08 20:52:52 +00:00
2026-03-03 00:48:38 +01:00
2026-05-05 12:54:40 +05:30
2026-06-14 11:10:12 +02:00
2026-03-10 13:52:18 +01:00
2026-05-25 01:15:28 +00:00
2026-03-10 13:52:18 +01:00
2026-04-28 12:29:37 +00:00
2026-03-10 13:52:18 +01: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-06-05 00:43:20 +02:00
2026-06-05 00:43:20 +02:00
2026-05-27 11:39:32 +00:00
2026-05-27 11:39:32 +00:00
2026-04-28 12:29:37 +00:00
2026-05-23 00:04:46 +00:00
2026-05-15 18:19:40 -07:00
2026-05-31 03:43:29 +00:00
2026-06-01 09:53:54 -03:00
2026-05-19 23:11:33 +00:00
2026-05-23 16:09:55 +02:00
2026-03-16 16:21:12 +00:00
2026-05-10 01:18:09 +00:00
2026-04-16 09:12:45 +00:00
2026-05-19 11:36:10 +02:00
2026-03-10 13:52:18 +01:00
2026-05-28 04:41:06 +00:00
2026-03-16 15:51:53 +01:00
2026-03-07 19:22:42 -03:00
2026-05-03 13:26:34 +00:00
2026-04-28 12:29:37 +00:00