What does Windows error code 605 (ERROR_BAD_COMPRESSION_BUFFER) mean?

 
Previous Next
ERROR_INVALID_VARIANT ERROR_AUDIT_FAILED

ERROR_BAD_COMPRESSION_BUFFER

The compression buffer cannot be decoded safely

The Windows Compression API can return this error when compressed bytes are corrupted or when raw-mode parameters do not match the data that was originally produced. With COMPRESS_RAW, the decompressor must use the same raw setting and the exact original uncompressed size; an incorrect size can produce this error or even misleading output.

Treat sizes embedded in untrusted compressed input as untrusted. Preserve the original compressed bytes, algorithm identifier, flags, compressed length, and expected uncompressed length for diagnosis. Distinguish this error from ERROR_INSUFFICIENT_BUFFER, which means the output destination is too small. Do not repeatedly allocate arbitrary sizes based solely on corrupted header values.

What to inspect

  • Verify compressor algorithm, raw flag, and original size metadata.
  • Check the compressed block for truncation or transport corruption.
  • Bound allocations derived from untrusted compressed input.

References


Looking for a different code? Search another status or error code.