dca: Read params->pancABIT0[param_index] only if part0 is set

Prevent a spurious read from uninitialized memory.
pull/125/head
Niels Möller 10 years ago committed by Luca Barbato
parent 48aef27f52
commit c9ed48e80e
  1. 2
      libavcodec/dca_xll.c

@ -514,8 +514,8 @@ int ff_dca_xll_decode_audio(DCAContext *s, AVFrame *frame)
} }
for (i = 0; i < chset->channels; i++) { for (i = 0; i < chset->channels; i++) {
int param_index = params->seg_type ? 0 : i; int param_index = params->seg_type ? 0 : i;
int bits = params->pancABIT0[param_index];
int part0 = params->nSamplPart0[param_index]; int part0 = params->nSamplPart0[param_index];
int bits = part0 ? params->pancABIT0[param_index] : 0;
int *sample_buf = s->xll_sample_buf + int *sample_buf = s->xll_sample_buf +
(in_channel + i) * s->xll_smpl_in_seg; (in_channel + i) * s->xll_smpl_in_seg;

Loading…
Cancel
Save