Robert Garrett 97ec583442 Fix backbuffer test
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.
2024-10-14 21:07:29 -05:00
2024-10-14 21:07:29 -05:00
Description
QOI codec library made in Rust
70 KiB
Languages
Rust 100%