Off-by-one bug in libavcodec/idcinvideo.c, caused
authorMatti Hamalainen <(mhamalai@students.oamk.fi>
Wed, 16 Feb 2005 22:42:41 +0000 (22:42 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 16 Feb 2005 22:42:41 +0000 (22:42 +0000)
segfaults on all .cin videos from Quake II.
patch by (Matti Hamalainen <mhamalai ratol fi>)

Originally committed as revision 3956 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/idcinvideo.c

index e53246b..f5df5a4 100644 (file)
@@ -192,7 +192,7 @@ static void idcin_decode_vlcs(IdcinContext *s)
 
             while(node_num >= HUF_TOKENS) {
                 if(!bit_pos) {
-                    if(dat_pos > s->size) {
+                    if(dat_pos >= s->size) {
                         av_log(s->avctx, AV_LOG_ERROR, "Huffman decode error.\n");
                         return;
                     }