diff options
author | Francesco Lavra <francescolavra@interfree.it> | 2010-02-13 17:42:58 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2010-02-13 17:42:58 +0000 |
commit | 7df8af6385834e58858779ed2fe85c0ce6b2ee1a (patch) | |
tree | 9dc4cdab07e53856fe163568530a36d7c0e0f596 /libavcodec/ra144.c | |
parent | f2a4f12cb6c543039f38d17d6e8415ff65738d63 (diff) | |
download | ffmpeg-7df8af6385834e58858779ed2fe85c0ce6b2ee1a.tar.gz |
Fix reading beyond buffer end on RA144Context.lpc_tables.
Patch by Francesco Lavra (francescolavra -at- interfree -dot- it)
Originally committed as revision 21796 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra144.c')
-rw-r--r-- | libavcodec/ra144.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 8fae69de35..04eb955dcb 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -219,7 +219,7 @@ static void int_to_int16(int16_t *out, const int *inp) { int i; - for (i=0; i < 30; i++) + for (i=0; i < 10; i++) *out++ = *inp++; } @@ -276,7 +276,7 @@ static int interp(RA144Context *ractx, int16_t *out, int a, // Interpolate block coefficients from the this frame's forth block and // last frame's forth block. - for (i=0; i<30; i++) + for (i=0; i<10; i++) out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2; if (eval_refl(work, out, ractx->avctx)) { @@ -297,7 +297,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *vdata, int buf_size = avpkt->size; static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; unsigned int refl_rms[4]; // RMS of the reflection coefficients - uint16_t block_coefs[4][30]; // LPC coefficients of each sub-block + uint16_t block_coefs[4][10]; // LPC coefficients of each sub-block unsigned int lpc_refl[10]; // LPC reflection coefficients of the frame int i, j; int16_t *data = vdata; |