Fixes: CID1473514 Uninitialized scalar variable
Unified · Split
| @@ -282,8 +282,10 @@ int ff_lpc_calc_coefs(LPCContext *s, · 281 unmodified lines | ||
| 282 | 282 | double av_uninit(weight); |
| 283 | 283 | memset(var, 0, FFALIGN(MAX_LPC_ORDER+1,4)*sizeof(*var)); |
| 284 | 284 | |
| 285 | − for(j=0; j<max_order; j++) | |
| 286 | − m[0].coeff[max_order-1][j] = -lpc[max_order-1][j]; | |
| 285 | + /* Avoids initializing with an unused value when lpc_passes == 1 */ | |
| 286 | + if (lpc_passes > 1) | |
| 287 | + for(j=0; j<max_order; j++) | |
| 288 | + m[0].coeff[max_order-1][j] = -lpc[max_order-1][j]; | |
| 287 | 289 | |
| 288 | 290 | for(; pass<lpc_passes; pass++){ |
| 289 | 291 | avpriv_init_lls(&m[pass&1], max_order); |