[Flac-dev] Fixed: ERROR: mismatch in decoded data, verify FAILED!

Josh Coalson
Fri, 10 Sep 2004 16:45:27 -0000

> Also, Kai has been kind enough to send me a copy of his file which
> has a
> problem only on -8, which I'll be looking into soon.

After some intense debugging, I found the problem.  One
block in the file triggered a very rare bug in the LPC
coefficient quantizer caused by insufficient floating
point precision.  There is a snippet to compute the
log(base 2) of a number:

	floor(log(cmax) / M_LN2)

It turns out on at least some x86's compiling with gcc-2.91
(at least) the result of floor(log(8.0) / M_LN2) is 2.0 not
3.0.  Anyway, I made a fix and also added code to detect
and handle similar problems (related to FP accuracy).