Test files › Audio and video › declared-length-mismatch.wav

Corrupt WAV file (declared length mismatch)

Valid WAV whose data chunk header declares ten times more bytes than the file actually contains.

↓ Download declared-length-mismatch.wav
Filenamedeclared-length-mismatch.wav
FormatWAV
Size172 KB (176,444 bytes)
MIME typeaudio/wav
SHA-256fa849fa10674fce6a798353aad7913789f3dd054fa4b677ad368ee8e1e21d790
What this file catchesDecoders that trust the declared chunk length and either read past the buffer or hang waiting for data that never arrives. A robust decoder clamps to the actual file size.

Handle it in code

Each snippet below was run against this exact file with Python 3.14.4 and Node 24.15.0 when this page was built, and the output shown is what it printed.

Python

Compare what the header declares with what the file holds, and refuse a header that is itself cut short.

import wave

try:
    with wave.open("declared-length-mismatch.wav") as w:
        declared = w.getnframes()
        frame_size = w.getsampwidth() * w.getnchannels()
        actual = len(w.readframes(declared)) // frame_size
    note = "truncated or lying header" if actual < declared else "ok"
    print(f"header says {declared} frames, file holds {actual}: {note}")
except (wave.Error, EOFError) as e:
    print("rejected:", str(e) or "the header is cut short")

Run against this file, it prints: header says 882000 frames, file holds 88200: truncated or lying header

Related guides and tools

Sample MP3, WAV and MP4 filesFile signaturesMIME typesCheck a file's real typeVerify its SHA-256

Download & verify

curl -fsSL -o "declared-length-mismatch.wav" "https://files.hexaqa.com/audio/declared-length-mismatch.wav"
curl -fsSL "https://files.hexaqa.com/audio/declared-length-mismatch.wav" | sha256sum # expect: fa849fa10674fce6a798353aad7913789f3dd054fa4b677ad368ee8e1e21d790

More audio and video test files

no-id3-raw.mp3silence-30s.wavsilence-5s.mp3tone-5s.wavtruncated-header.wavvery-short-10ms.wavempty-ftyp-only.mp4fake-mp4-wrong-magic.mp4

← All Audio and video files