[flac-dev] [PATCH] treat negative qlp_shift as an error

Erik de Castro Lopo mle+la at mega-nerd.com
Tue Aug 11 02:44:53 PDT 2015


lvqcl wrote:

> Josh Coalson wrote in 2009 <http://lists.xiph.org/pipermail/flac-dev/2009-April/002654.html>:
> 
> "the reference encoder has
> avoided negative shifts entirely since 1.1.4.  negative shifts
> were meant to be positive shifts in the opposite direction but
> they were implemented directly with << >> and in C negative shifts
> are undefined.
> treat as an error for now to avoid bad behavior but I need to
> come back to this to specify exactly."
> 
> But libFLAC itself doesn't care about their values. It checks a value
> of qlp_coeff_precision, though. So this patch adds a check of
> a value of quantization_level.
> 
> 
> I'm not sure what should libFLAC do if a negative (=invalid) value of
> quantization_level is encountered. But it seems logical that it should
> treat an invalid value of quantization_level in the same way as it treats
> an invalid value of qlp_coeff_precision.
> 
> The patch should also remove "shift exponent is negative" errors
> reported at <https://sourceforge.net/p/flac/bugs/431/>.
> See also <https://sourceforge.net/p/flac/bugs/424/>.

Applied. Thanks.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the flac-dev mailing list