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.
This commit is contained in:
1 parent
1d138a5568
commit
87341f9075
1 file changed
+2
-2
+2
-2
@@ -390,7 +390,7 @@ impl ValueBuffer {
|
|||||||
debug_assert!({
|
debug_assert!({
|
||||||
self.ty
|
self.ty
|
||||||
.value_bytes(self.count)
|
.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
|
self.count
|
||||||
@@ -439,7 +439,7 @@ impl ValueBuffer {
|
|||||||
pub(crate) fn assume_type(&mut self, ty: Type, count: u64, bo: ByteOrder) {
|
pub(crate) fn assume_type(&mut self, ty: Type, count: u64, bo: ByteOrder) {
|
||||||
debug_assert!({
|
debug_assert!({
|
||||||
ty.value_bytes(count)
|
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;
|
self.byte_order = bo;
|
||||||
|
|||||||
Reference in new issue
Block a user