[FFmpeg-cvslog] adpcmdec: fix "warning: array subscript is above array bounds"

Michael Niedermayer git at videolan.org
Sat Feb 25 03:03:05 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb 25 02:50:58 2012 +0100| [7b9d8703f35585b065c32194b52131b7dd90c710] | committer: Michael Niedermayer

adpcmdec: fix "warning: array subscript is above array bounds"

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b9d8703f35585b065c32194b52131b7dd90c710
---

 libavcodec/adpcm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index c21753a..19289e8 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1190,7 +1190,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
 
         /* Initialize the previous sample.  */
         for (i = 0; i < 4; i++)
-            prev[0][i] = (int16_t)bytestream_get_be16(&src);
+            prev[i>>1][i&1] = (int16_t)bytestream_get_be16(&src);
 
         for (ch = 0; ch <= st; ch++) {
             samples = (short *)c->frame.data[0] + ch;



More information about the ffmpeg-cvslog mailing list