History

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

Fixes: CID1473514 Uninitialized scalar variable

Michael Niedermayer committed 2 years ago

Commit c2d897f1 parent c3047841 file · +4 −2Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/lpc.c+4−2
@@ -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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t