diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 1e78f385f8..7c07138007 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5521,6 +5521,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, goto err; } + if ((s->mb_height >> v->field_mode) == 0) { + av_log(v->s.avctx, AV_LOG_ERROR, "image too short\n"); + goto err; + } + // process pulldown flags s->current_picture_ptr->f.repeat_pict = 0; // Pulldown flags are only valid when 'broadcast' has been set.