In case you try to compress a 24-bit mono (probably all files with odd number of channels) wave file (packed) with an odd length (in samples), resulting in an odd length of the audio data chunk (3*length_in_samples) flac wonīt read the chunks after the audio chunk correctly, because itīs one byte out-of-sync, it skips the first byte and starts reading the next chunk like "ext\" (the last byte from length) instead of "bext". Of course it also reads the wrong length now and it says wave file is broken.

Encoding without "--keep-foreign-metadata" results just in wrong messages, but with this option encoding will fail. Fortunately flac does not seem to create broken files, either the sub-chunks are ignored or it fails.