src/libFLAC/lpc.c : Restore missing conditional.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 31 Mar 2015 07:08:09 +0000 (18:08 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 30 Mar 2015 23:14:17 +0000 (10:14 +1100)
Git commit 9c2290ade5 in-correctly removed a conditional around
an fprintf. Thanks to mark4o on #xiph (freenode) for reporting
this.

src/libFLAC/lpc.c

index f7c643a..5c6e175 100644 (file)
@@ -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);