From c5f37969e660ab8d149e54eaf58bcaeac92e8b7c Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 3 Nov 2026 11:45:40 +0000 Subject: [PATCH] hevc: give each slice segment its own entry-point list instead of keeping the copied one's allocation --- crates/hevc/src/slice.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/hevc/src/slice.rs b/crates/hevc/src/slice.rs index aadf6159f..3d6233fb6 100644 --- a/crates/hevc/src/slice.rs +++ b/crates/hevc/src/slice.rs @@ -326,7 +326,9 @@ impl SliceHeader { /// entry_point_offset list (tiles / wavefront substreams). fn parse_entry_points(&mut self, r: &mut BitReader, pps: &Pps, sps: &Sps) -> Result<()> { - self.entry_points.clear(); + // A fresh list, not `clear()`: a dependent segment starts as a copy of its independent + // segment's header, and clearing would keep that copy's allocation for every segment. + self.entry_points = Vec::new(); if pps.tiles_enabled || pps.entropy_coding_sync { let n = r.read_ue()?; ensure!(n <= sps.pic_width_in_ctbs() * sps.pic_height_in_ctbs(), "num_entry_point_offsets out of range");