diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c index f7c643a8..5c6e1750 100644 --- a/src/libFLAC/lpc.c +++ b/src/libFLAC/lpc.c @@ -288,6 +288,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 * flac_r for(j = 0; j < order; j++) { sum += qlp_coeff[j] * (*(--history)); sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history); + if(sumo > 2147483647ll || sumo < -2147483648ll) fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%" PRId64 "\n",i,j,qlp_coeff[j],*history,sumo); } *(residual++) = *(data++) - (sum >> lp_quantization);