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
282282 double av_uninit(weight);
283283 memset(var, 0, FFALIGN(MAX_LPC_ORDER+1,4)*sizeof(*var));
284284
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];
287289
288290 for(; pass<lpc_passes; pass++){
289291 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