Skip to content

Commit 1bd6293

Browse files
authored
Merge pull request #329 from image-rs/fixup-value-buffer-debug-condition
Fix debug condition of ValueBuffer
2 parents 43343f6 + 87341f9 commit 1bd6293

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ impl ValueBuffer {
390390
debug_assert!({
391391
self.ty
392392
.value_bytes(self.count)
393-
.is_ok_and(|n| n < self.bytes.len() as u64)
393+
.is_ok_and(|n| n <= self.bytes.len() as u64)
394394
});
395395

396396
self.count
@@ -439,7 +439,7 @@ impl ValueBuffer {
439439
pub(crate) fn assume_type(&mut self, ty: Type, count: u64, bo: ByteOrder) {
440440
debug_assert!({
441441
ty.value_bytes(count)
442-
.is_ok_and(|n| n < self.bytes.len() as u64)
442+
.is_ok_and(|n| n <= self.bytes.len() as u64)
443443
});
444444

445445
self.byte_order = bo;

0 commit comments

Comments
 (0)