97ec583442015bbf3f23868a4001f1d107f3532d
The backbuffer indices were all kinds of wrong, and there was even a state corruption bug. Hash values were simply done wrong. I've added some value delta notes to the compressed byte array, and then tracked all the state changes next to the expected indices array. The last RGBA value also needed to be included. Off by one, oops. The state corruption exists as a side effect of malformed OP_INDEXs. This is actually a bigger issue, and I'll need to add a new test for it. Basically: A pixel produced by an OP_INDEX will hash to that index. That's the definition of an OP_INDEX. What happens if an OP_INDEX picks up a pixel that hashes to a different index? Because an OP_INDEX is reading from the backbuffer array without modification, it doesn't need to write. An otherwise valid encoder can then skip the write step. This causes a missing buffer update when the pixel should land on another index. The decoder is now in a corrupted state.
Description
QOI codec library made in Rust
Languages
Rust
100%