From ddd0d51137d3b358e59916d7cd0503269a547f68 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Sun, 4 Feb 2007 04:18:55 +0000 Subject: [PATCH] in FLAC__lpc_quantize_coefficients(), clip shift to max_shiftlimit --- src/libFLAC/lpc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c index c7ce227e..768ae702 100644 --- a/src/libFLAC/lpc.c +++ b/src/libFLAC/lpc.c @@ -185,18 +185,10 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, log2cmax--; *shift = (int)precision - log2cmax - 1; - if(*shift < min_shiftlimit || *shift > max_shiftlimit) { -#ifdef FLAC__OVERFLOW_DETECT - fprintf(stderr,"FLAC__lpc_quantize_coefficients: shift out of limit: shift=%d cmax=%f precision=%u\n",*shift,cmax,precision+1); -#endif -#if 0 - /*@@@ this does not seem to help at all, but was not extensively tested either: */ - if(*shift > max_shiftlimit) - *shift = max_shiftlimit; - else -#endif - return 1; - } + if(*shift > max_shiftlimit) + *shift = max_shiftlimit; + else if(*shift < min_shiftlimit) + return 1; } if(*shift >= 0) {