[FFmpeg-cvslog] 4xm: check if there are bits left in decode_i_block()

Michael Niedermayer git at videolan.org
Wed Dec 14 22:31:45 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 14 22:20:39 2011 +0100| [e1ba29c76430ce511fd901c8b7a1bd199b169dc0] | committer: Michael Niedermayer

4xm: check if there are bits left in decode_i_block()
Fixed Ticket753
Bug Found by: Diana Elena Muscalu

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 9350f06..f854f1c 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -459,6 +459,11 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){
 static int decode_i_block(FourXContext *f, DCTELEM *block){
     int code, i, j, level, val;
 
+    if(get_bits_left(&f->gb) < 2){
+        av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n", get_bits_left(&f->gb));
+        return -1;
+    }
+
     /* DC coef */
     val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
     if (val>>4){



More information about the ffmpeg-cvslog mailing list