At some point after 0.16 my code started crashing when I was using an offset in from_bytes() where the input bits total more than 128 bytes. So if I have something like this, for example:
match AccuracyDescriptionRecord::from_bytes((&data, 1032)) {
Ok((_remaining_data, acc_desc_record)) => acc_desc_record.print(),
Err(error) => panic!("Error getting Accuracy Description Record from data: {error}"),
}
The error looks like:
thread 'main' panicked at /Users/justin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deku-0.18.1/src/reader.rs:258:63:
range end index 434 out of range for slice of length 128
This seems to be happening because from_bytes() is limiting the input offset to the MAX_BITS_AMT in the reader.
At some point after 0.16 my code started crashing when I was using an offset in from_bytes() where the input bits total more than 128 bytes. So if I have something like this, for example:
The error looks like:
This seems to be happening because from_bytes() is limiting the input offset to the MAX_BITS_AMT in the reader.