summaryrefslogtreecommitdiff
path: root/libavcodec/g723_1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-16 21:25:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-16 21:36:44 +0100
commit6535d81d8788a6eb758dd08330d4915c224fa5ee (patch)
tree4bdbfa3396f6a44237a4b9a54da90d0e822b7ec2 /libavcodec/g723_1.c
parent2207ea44fb4fad4d47646a789bc244e3e84c1726 (diff)
g723_1dec: Fix lsp2lpc() so it can handle values at the ends of the table.
Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r--libavcodec/g723_1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index 58df03c0ef..fd6b558ef3 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -359,7 +359,7 @@ static void lsp2lpc(int16_t *lpc)
/* Calculate negative cosine */
for (j = 0; j < LPC_ORDER; j++) {
- int index = lpc[j] >> 7;
+ int index = (lpc[j] >> 7) & 0x1FF;
int offset = lpc[j] & 0x7f;
int temp1 = cos_tab[index] << 16;
int temp2 = (cos_tab[index + 1] - cos_tab[index]) *