From e456460706c782a5af334b0791bf969f1fceda64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 15:13:05 +0300 Subject: [PATCH] S5: deblock scratch pool locks use PoisonError::into_inner; a panicked thread no longer aborts every later decode (pool state is a plain Vec, safe to reuse) --- crates/ec-av1/src/decode/deblock.rs | 2 +- crates/ec-av1/src/decode/replay.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ec-av1/src/decode/deblock.rs b/crates/ec-av1/src/decode/deblock.rs index 651a9dc9..a09f8940 100644 --- a/crates/ec-av1/src/decode/deblock.rs +++ b/crates/ec-av1/src/decode/deblock.rs @@ -711,7 +711,7 @@ pub(super) const SCRATCH_CAP: usize = 32; /// luma-sized allocation (every pooled buffer would drift to the largest /// size otherwise). `None` when the pool is empty. fn scratch_take(n: usize) -> Option> { - let mut p = PLANE_SCRATCH.lock().unwrap(); + let mut p = PLANE_SCRATCH.lock().unwrap_or_else(std::sync::PoisonError::into_inner); if p.is_empty() { return None; } diff --git a/crates/ec-av1/src/decode/replay.rs b/crates/ec-av1/src/decode/replay.rs index 732747c9..c0b7594d 100644 --- a/crates/ec-av1/src/decode/replay.rs +++ b/crates/ec-av1/src/decode/replay.rs @@ -395,7 +395,7 @@ pub(super) fn crop_owned(plane: PlaneBuf<'_>, w: usize, h: usize) -> Vec { /// Over [`SCRATCH_CAP`] the buffer is dropped (freed) instead -- the cap is /// what keeps a pool shared by every thread from being an unbounded stash. pub(super) fn scratch_return(v: Vec) { - let mut p = PLANE_SCRATCH.lock().unwrap(); + let mut p = PLANE_SCRATCH.lock().unwrap_or_else(std::sync::PoisonError::into_inner); if p.len() < SCRATCH_CAP { p.push(v); }