From 87341f90755cdd7d385094066673295b886dfc5d Mon Sep 17 00:00:00 2001 From: "A. Molzer" <5550310+197g@users.noreply.github.com> Date: Tue, 13 Jan 2026 15:34:02 +0100 Subject: [PATCH] Fix debug condition of ValueBuffer Off-by-one, this was meant to check a minimum length that includes equality but instead tested a valid index. --- src/tags.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tags.rs b/src/tags.rs index a689dfa..2633879 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -390,7 +390,7 @@ impl ValueBuffer { debug_assert!({ self.ty .value_bytes(self.count) - .is_ok_and(|n| n < self.bytes.len() as u64) + .is_ok_and(|n| n <= self.bytes.len() as u64) }); self.count @@ -439,7 +439,7 @@ impl ValueBuffer { pub(crate) fn assume_type(&mut self, ty: Type, count: u64, bo: ByteOrder) { debug_assert!({ ty.value_bytes(count) - .is_ok_and(|n| n < self.bytes.len() as u64) + .is_ok_and(|n| n <= self.bytes.len() as u64) }); self.byte_order = bo;