[FFmpeg-cvslog] r21796 - trunk/libavcodec/ra144.c

vitor subversion
Sat Feb 13 18:42:59 CET 2010


Author: vitor
Date: Sat Feb 13 18:42:58 2010
New Revision: 21796

Log:
Fix reading beyond buffer end on RA144Context.lpc_tables.

Patch by Francesco Lavra (francescolavra -at- interfree -dot- it)

Modified:
   trunk/libavcodec/ra144.c

Modified: trunk/libavcodec/ra144.c
==============================================================================
--- trunk/libavcodec/ra144.c	Sat Feb 13 17:56:37 2010	(r21795)
+++ trunk/libavcodec/ra144.c	Sat Feb 13 18:42:58 2010	(r21796)
@@ -219,7 +219,7 @@ static void int_to_int16(int16_t *out, c
 {
     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, i
 
     // 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(AVCodecCon
     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;



More information about the ffmpeg-cvslog mailing list