Browse Source

Check number of bits so we do not try to use table entries which do not exist.

Originally committed as revision 13785 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 17 years ago
parent
commit
35d0e16ba1
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/g726.c

+ 4
- 0
libavcodec/g726.c View File

@@ -334,6 +334,10 @@ static av_cold int g726_init(AVCodecContext * avctx)
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;


Loading…
Cancel
Save