Mercurial > libavcodec.hg
changeset 7048:167726a95509 libavcodec
Check number of bits so we do not try to use table entries which do not exist.
author | michael |
---|---|
date | Mon, 16 Jun 2008 23:16:44 +0000 |
parents | 4b5b586a3dd0 |
children | bb24d15211a4 |
files | g726.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/g726.c Mon Jun 16 23:12:50 2008 +0000 +++ b/g726.c Mon Jun 16 23:16:44 2008 +0000 @@ -334,6 +334,10 @@ av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); return -1; } + if(index>3){ + av_log(avctx, AV_LOG_ERROR, "Unsupported number of bits %d\n", index+2); + return -1; + } g726_reset(&c->c, index); c->code_size = c->c.tbls->bits; c->bit_buffer = 0;