[FFmpeg-cvslog] r13785 - trunk/libavcodec/g726.c

michael subversion
Tue Jun 17 01:16:44 CEST 2008


Author: michael
Date: Tue Jun 17 01:16:44 2008
New Revision: 13785

Log:
Check number of bits so we dont try to use table entries which dont
exist.


Modified:
   trunk/libavcodec/g726.c

Modified: trunk/libavcodec/g726.c
==============================================================================
--- trunk/libavcodec/g726.c	(original)
+++ trunk/libavcodec/g726.c	Tue Jun 17 01:16:44 2008
@@ -334,6 +334,10 @@ static av_cold int g726_init(AVCodecCont
         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;




More information about the ffmpeg-cvslog mailing list