aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-04-29 01:17:37 +0100
committerMans Rullgard <mans@mansr.com>2012-05-01 00:21:30 +0100
commita812ed003f75ad8f90035ab3b88369ee7f3e1bd1 (patch)
treea613ce2e21271e0f3bcfe79a14d422d899be4485 /libavcodec
parentc81d1e2390ce7d3182d4176723384e65a771844c (diff)
downloadffmpeg-a812ed003f75ad8f90035ab3b88369ee7f3e1bd1.tar.gz
adpcm-thp: fix invalid array indexing
Indexing outside array limits is invalid and breaks with gcc 4.8. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 41d0d98d26..8170e7f416 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1209,12 +1209,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int prev[2][2];
int ch;
- for (i = 0; i < 32; i++)
- table[0][i] = sign_extend(bytestream2_get_be16u(&gb), 16);
+ for (i = 0; i < 2; i++)
+ for (n = 0; n < 16; n++)
+ table[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
/* Initialize the previous sample. */
- for (i = 0; i < 4; i++)
- prev[0][i] = sign_extend(bytestream2_get_be16u(&gb), 16);
+ for (i = 0; i < 2; i++)
+ for (n = 0; n < 2; n++)
+ prev[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
for (ch = 0; ch <= st; ch++) {
samples = (short *)c->frame.data[0] + ch;