dca: Read params->pancABIT0[param_index] only if part0 is set
authorNiels Möller <nisse@lysator.liu.se>
Mon, 16 Mar 2015 21:31:41 +0000 (22:31 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 17 Mar 2015 11:31:07 +0000 (12:31 +0100)
Prevent a spurious read from uninitialized memory.

libavcodec/dca_xll.c

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