diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-11 03:33:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-11 03:33:59 +0200 |
commit | 940be96540ee58e65b3730665b32819dda8d8d32 (patch) | |
tree | a9c4c1ae9df9d1591abf39c38a54fbc4b6d54fa1 /libavcodec/dcaenc.c | |
parent | 8616c446060ce454885254fbecbf32f437e0b827 (diff) | |
download | ffmpeg-940be96540ee58e65b3730665b32819dda8d8d32.tar.gz |
dcaenc: fix out of array read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dcaenc.c')
-rw-r--r-- | libavcodec/dcaenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index d6efd250d5..f0b6f8111e 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -503,13 +503,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, samples = (const int16_t *)frame->data[0]; for (i = 0; i < PCM_SAMPLES; i ++) { /* i is the decimated sample number */ for (channel = 0; channel < c->prim_channels + 1; channel++) { - /* Get 32 PCM samples */ - for (k = 0; k < 32; k++) { /* k is the sample number in a 32-sample block */ - c->pcm[k] = samples[avctx->channels * (32 * i + k) + channel] << 16; - } - /* Put subband samples into the proper place */ real_channel = c->channel_order_tab[channel]; if (real_channel >= 0) { + /* Get 32 PCM samples */ + for (k = 0; k < 32; k++) { /* k is the sample number in a 32-sample block */ + c->pcm[k] = samples[avctx->channels * (32 * i + k) + channel] << 16; + } + /* Put subband samples into the proper place */ qmf_decompose(c, c->pcm, &c->subband[i][real_channel][0], real_channel); } } |