avcodec/lpc: account for odd len values

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-05-31 09:38:27 -03:00
parent 2f184aa89b
commit e0db1f51d6

View File

@ -120,9 +120,8 @@ static void lpc_compute_autocorr_c(const double *data, ptrdiff_t len, int lag,
if(j==lag){
double sum = 1.0;
for(i=j-1; i<len; i+=2){
sum += data[i ] * data[i-j ]
+ data[i+1] * data[i-j+1];
for(i=j-1; i<len; i++){
sum += data[i] * data[i-j];
}
autoc[j] = sum;
}