From 85e538d49929f8c3091e57cd6e9cb2a6521235e2 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 4 Oct 2024 08:20:38 +0200 Subject: [PATCH] Remove crashy unwrap() in on_error --- src/decode.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/decode.rs b/src/decode.rs index 6695e9798..9a3de607b 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -4994,7 +4994,10 @@ pub fn rav1d_submit_frame(c: &Rav1dContext, state: &mut Rav1dState) -> Rav1dResu ) { fc.task_thread.error.store(1, Ordering::Relaxed); let _ = mem::take(&mut *fc.in_cdf.try_write().unwrap()); - if f.frame_hdr.as_ref().unwrap().refresh_context != 0 { + if f.frame_hdr + .as_ref() + .is_some_and(|frame_hdr| frame_hdr.refresh_context != 0) + { let _ = mem::take(&mut f.out_cdf); } for i in 0..7 {