[FFmpeg-cvslog] vc1dec: check that coded slice positions and interlacing match.

Michael Niedermayer git at videolan.org
Thu Apr 19 11:21:42 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Apr 19 11:02:22 2012 +0200| [5e59a77cec804a9b44c60ea22c17beba6453ef23] | committer: Michael Niedermayer

vc1dec: check that coded slice positions and interlacing match.

This fixes out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index f5580bf..309194e 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5578,6 +5578,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
         mb_height = s->mb_height >> v->field_mode;
         for (i = 0; i <= n_slices; i++) {
             if (i > 0 &&  slices[i - 1].mby_start >= mb_height) {
+                if(v->field_mode <= 0) {
+                    av_log(v->s.avctx, AV_LOG_ERROR, "invalid end_mb_y %d\n", slices[i - 1].mby_start);
+                    continue;
+                }
                 v->second_field = 1;
                 v->blocks_off   = s->mb_width  * s->mb_height << 1;
                 v->mb_off       = s->mb_stride * s->mb_height >> 1;



More information about the ffmpeg-cvslog mailing list