summaryrefslogtreecommitdiff
path: root/libavcodec/twinvq.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-02 21:12:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-02 21:12:34 +0200
commit2330eb147412b96bef148b120e5a3897c9c87858 (patch)
treef53aa47a22318e11b2b2cc39784798a9cd3aa9cf /libavcodec/twinvq.c
parent2cda0429aa764d157569d7534777c58dac8a4962 (diff)
parentababec7b95d84e911ecda6056e8b8c90287a6e7a (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: arm: intreadwrite: disable inline asm for gcc 4.7 and later arm: intreadwrite: fix inline asm constraints for gcc 4.6 and later indeo3: fix motion vector validation pcm_bluray: set bits_per_raw_sample for > 16-bit twinvq: fix out of bounds array access lavr: use 8.8 instead of 10.6 as the 16-bit fixed-point mixing coeff type Conflicts: doc/APIchanges libavcodec/indeo3.c libavcodec/pcm-mpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/twinvq.c')
-rw-r--r--libavcodec/twinvq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index 88f29d8726..d1ee695bce 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -1000,14 +1000,16 @@ static av_cold void construct_perm_table(TwinContext *tctx,enum FrameType ftype)
{
int block_size;
const ModeTab *mtab = tctx->mtab;
- int size = tctx->avctx->channels*mtab->fmode[ftype].sub;
+ int size;
int16_t *tmp_perm = (int16_t *) tctx->tmp_buf;
if (ftype == FT_PPC) {
size = tctx->avctx->channels;
block_size = mtab->ppc_shape_len;
- } else
+ } else {
+ size = tctx->avctx->channels * mtab->fmode[ftype].sub;
block_size = mtab->size / mtab->fmode[ftype].sub;
+ }
permutate_in_line(tmp_perm, tctx->n_div[ftype], size,
block_size, tctx->length[ftype],