While using wavinfo on wav files (converted with ffmpeg), I noticed the sample count is wrong (real large).
The problem comes from the fact that ffmpeg always uses a 18 bytes block size for the fmt section, while wavinfo seems to assume it's always 16 bytes.
The standard says if type is PCM then size should be 16, but can be 18 for other formats.
wavinfo should either refuse to read the malformed wav file or use the actual fmt block size, not return nonsense. This involves splitting the wave_t structure in two or maybe using an union.
Attached is a sample wav file.
Note that readsf~ is able to read the file.