aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g726.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-06-16 23:16:44 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-06-16 23:16:44 +0000
commit35d0e16ba12ab439c9155b9dd3bf8ba46c8bf517 (patch)
tree66076ca6a482f63ae5f47b0aa7281b08875ce142 /libavcodec/g726.c
parent8161c28c67662db6857ea8023cfcaa0416cd1a52 (diff)
downloadffmpeg-35d0e16ba12ab439c9155b9dd3bf8ba46c8bf517.tar.gz
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
Diffstat (limited to 'libavcodec/g726.c')
-rw-r--r--libavcodec/g726.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index 15c5fa6620..13dce4f590 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -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;