From cdeddbd07ed5a0a1437b0cb73f08e55abbf90494 Mon Sep 17 00:00:00 2001 From: techmetx11 Date: Tue, 9 Jul 2024 22:06:27 +0100 Subject: [PATCH] Switch the byteswapping to regular shifting --- src/opcode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opcode.rs b/src/opcode.rs index 2ca3629..5cdd1ed 100644 --- a/src/opcode.rs +++ b/src/opcode.rs @@ -60,7 +60,7 @@ impl Decoder for OpcodeDecoder { return Ok(None); } - let sig_size: u16 = u16::from_be_bytes(src[5..6].try_into().unwrap()); + let sig_size: u16 = ((src[5] as u16) << 8) | src[6] as u16; if (usize::from(sig_size) + 7) > src.len() { return Ok(None);