From 47384980a4bbf1e03ce94d8e06f9c5fa057295b1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 07:44:01 -0500 Subject: [PATCH] psd: cover the shared PackBits row-limit error mapping The recovery wrapper maps every non-decompress failure to Error::Invalid so a limit refusal is never reported as truncated data. That arm had no test, which left the changed lines under the coverage gate. --- crates/psd/src/tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/psd/src/tests.rs b/crates/psd/src/tests.rs index e2b92b180..7fe3fe387 100644 --- a/crates/psd/src/tests.rs +++ b/crates/psd/src/tests.rs @@ -609,3 +609,10 @@ fn shared_packbits_keeps_padded_rows_and_truncated_packet_errors() { unpack_bits(&[0, 9, 255], 1, &mut row).unwrap(); assert_eq!(row, [9]); } + +#[test] +fn shared_packbits_reports_row_limits_as_invalid_not_truncated() { + // The shared recovery decoder refuses a row beyond its decoded-size limit. That refusal + // is a limit, not truncated PackBits data, so the wrapper must not report it as one. + assert!(matches!(unpack_bits(&[], usize::MAX, &mut Vec::new()), Err(Error::Invalid(_)))); +}