diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-11-23 17:10:51 -0500 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-30 10:58:45 -0500 |
commit | b74b88f30da2389f333a31815d8326d5576d3331 (patch) | |
tree | 3c909c8a8f0871764d6449e14ddd72dedaec7456 /libavcodec/g723_1.c | |
parent | a0fa6d06b848f26b16ba12f0a9a4a85b93ab8022 (diff) | |
download | ffmpeg-b74b88f30da2389f333a31815d8326d5576d3331.tar.gz |
g723_1: Handle values at the ends of the table in lsp2lpc()
Fixes out of array reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r-- | libavcodec/g723_1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index 4904e52ac0..80c7d1f491 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -386,7 +386,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]) * |