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