4xm: pass the correct remaining buffer size to decode_i2_frame().
authorAneesh Dogra <lionaneesh@gmail.com>
Wed, 4 Jan 2012 18:40:01 +0000 (00:10 +0530)
committerRonald S. Bultje <rsbultje@gmail.com>
Thu, 5 Jan 2012 05:10:11 +0000 (21:10 -0800)
frame_size is the number of bytes left in the packet, so if we are passing
buf-4 we can safely read frame_size+4 bytes.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/4xm.c

index 7cda26e..cfb8279 100644 (file)
@@ -786,7 +786,7 @@ static int decode_frame(AVCodecContext *avctx,
 
     if(frame_4cc == AV_RL32("ifr2")){
         p->pict_type= AV_PICTURE_TYPE_I;
-        if(decode_i2_frame(f, buf-4, frame_size) < 0)
+        if(decode_i2_frame(f, buf-4, frame_size + 4) < 0)
             return -1;
     }else if(frame_4cc == AV_RL32("ifrm")){
         p->pict_type= AV_PICTURE_TYPE_I;