[FFmpeg-cvslog] 4xm: pass the correct remaining buffer size to decode_i2_frame().

Aneesh Dogra git at videolan.org
Fri Jan 6 02:53:06 CET 2012


ffmpeg | branch: master | Aneesh Dogra <lionaneesh at gmail.com> | Thu Jan  5 00:28:01 2012 +0530| [4b84f682232205eee84e0e6bea1858be8e234129] | committer: Ronald S. Bultje

4xm: pass the correct remaining buffer size to decode_i2_frame().

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b84f682232205eee84e0e6bea1858be8e234129
---

 libavcodec/4xm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 7cda26e..cfb8279 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -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;



More information about the ffmpeg-cvslog mailing list