Files
FFmpeg/libavformat
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-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-05-08 09:34:52 +02:00
2026-05-31 03:43:29 +00:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-05-29 01:49:20 +00:00
2026-05-25 00:10:18 +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-23 10:16:38 -05:00
2026-05-23 10:16:38 -05:00
2026-03-10 13:52:18 +01:00
2026-05-22 08:20:13 -05:00
2026-05-03 13:26:34 +00:00
2026-05-03 18:22:46 +02:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-05-23 00:04:46 +00:00
2026-03-10 13:52:18 +01:00