Comment by jleahy

5 years ago

A 1-bit error in a compressed file will cause every subsequent bit in the entire file to end up wrong (well, 50% of them), and probably the file length to end up wrong, and probably the decompression state machine to get stuck and confused. This is why basically all compressed formats carry a CRC (eg. zip, gz, xz).

Most games don’t store their assets in a single one-shot-load pack file anymore. They use chunked asset files where individual assets or packs will be compressed and then concatenated with a master index, meaning you don’t have to load the whole file when the engine needs only a subset. This means the checksums necessarily cannot cover the entire data file, because then you would need to read the entire file to verify a single asset anyway, throwing away the benefits of random access. You can also turn the checksums off for “speed,” and some do.

If you have something like a Deflate stream, there is a chance that the flipped bit will affect a symbol but change it into a symbol with the same length. Could do anything from changing a single byte in the output, to changing bytes in a bounded range, to corrupting the entire rest of the stream, or making it fail to decompress (not every deflate stream is valid, far from it).