Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-19 13:02:22 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-04-19 13:16:56 +0400
commit5e59a77cec804a9b44c60ea22c17beba6453ef23 (patch)
tree0fa21fcd81b7ebe6e437405da226c964a1a7126d /libavcodec/vc1dec.c
parentdf23d64e0781a6b7389a1dd2627c65f7cb131278 (diff)
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@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index f5580bfafb..309194e911 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;