[FFmpeg-cvslog] vc1: prevent null pointer dereference on broken files

Janne Grunau git at videolan.org
Thu Feb 2 02:46:25 CET 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Wed Jan 25 15:49:54 2012 +0100| [510ef04a461b3b54a762c6141ad880cbed85981f] | committer: Janne Grunau

vc1: prevent null pointer dereference on broken files

CC: libav-stable at libav.org

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

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

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 325cc64..417bd04 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5709,7 +5709,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
             if (!v->field_mode || v->second_field)
                 s->end_mb_y = (i == n_slices     ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
             else
-                s->end_mb_y = (i == n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
+                s->end_mb_y = (i <= n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
             vc1_decode_blocks(v);
             if (i != n_slices)
                 s->gb = slices[i].gb;



More information about the ffmpeg-cvslog mailing list