Mercurial > libavcodec.hg
comparison g726.c @ 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 |
comparison
equal
deleted
inserted
replaced
7047:4b5b586a3dd0 | 7048:167726a95509 |
---|---|
332 } | 332 } |
333 if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) { | 333 if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) { |
334 av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); | 334 av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); |
335 return -1; | 335 return -1; |
336 } | 336 } |
337 if(index>3){ | |
338 av_log(avctx, AV_LOG_ERROR, "Unsupported number of bits %d\n", index+2); | |
339 return -1; | |
340 } | |
337 g726_reset(&c->c, index); | 341 g726_reset(&c->c, index); |
338 c->code_size = c->c.tbls->bits; | 342 c->code_size = c->c.tbls->bits; |
339 c->bit_buffer = 0; | 343 c->bit_buffer = 0; |
340 c->bits_left = 0; | 344 c->bits_left = 0; |
341 | 345 |