avcodec/lpc: copy levenson coeffs only when they have been computed

Fixes: CID1473514 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c2d897f356)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 10 months ago
parent 21efa2af53
commit 2de1f26366
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 6
      libavcodec/lpc.c

@ -250,8 +250,10 @@ int ff_lpc_calc_coefs(LPCContext *s,
double av_uninit(weight);
memset(var, 0, FFALIGN(MAX_LPC_ORDER+1,4)*sizeof(*var));
for(j=0; j<max_order; j++)
m[0].coeff[max_order-1][j] = -lpc[max_order-1][j];
/* Avoids initializing with an unused value when lpc_passes == 1 */
if (lpc_passes > 1)
for(j=0; j<max_order; j++)
m[0].coeff[max_order-1][j] = -lpc[max_order-1][j];
for(; pass<lpc_passes; pass++){
avpriv_init_lls(&m[pass&1], max_order);

Loading…
Cancel
Save