Merge pull request #329 from image-rs/fixup-value-buffer-debug-condition

Fix debug condition of ValueBuffer
This commit is contained in:
Aurelia Molzer authored and GitHub committed 2026-01-13 14:53:12 +00:00
commit 1bd6293857
1 file changed
+2 -2
+2 -2
View File
@@ -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;