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

Michael Niedermayer git at videolan.org
Sun Jul 29 02:26:21 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jul 28 17:14:50 2012 +0600| [1100acbab26883007898c53efeb289f562c6e514] | committer: Kostya Shishkov

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>
Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>

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

 libavcodec/vc1dec.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index f49fff8..5726c0a 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5569,6 +5569,12 @@ 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, "Slice %d starts beyond "
+                           "picture boundary (%d >= %d)\n", i,
+                           slices[i - 1].mby_start, mb_height);
+                    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