Commit 54623619 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8435bca0'

* commit '8435bca0':
  indeo4: Do not access missing reference MV

Conflicts:
	libavcodec/indeo4.c

See: 5216245a, aae44fb4Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ac20ba35 8435bca0
...@@ -510,8 +510,11 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band, ...@@ -510,8 +510,11 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
} }
} }
} else { } else {
if (band->inherit_mv && ref_mb) { if (band->inherit_mv) {
mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */ /* copy mb_type from corresponding reference mb */
if (!ref_mb)
return AVERROR_INVALIDDATA;
mb->type = ref_mb->type;
} else if (ctx->frame_type == FRAMETYPE_INTRA || } else if (ctx->frame_type == FRAMETYPE_INTRA ||
ctx->frame_type == FRAMETYPE_INTRA1) { ctx->frame_type == FRAMETYPE_INTRA1) {
mb->type = 0; /* mb_type is always INTRA for intra-frames */ mb->type = 0; /* mb_type is always INTRA for intra-frames */
...@@ -534,15 +537,16 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band, ...@@ -534,15 +537,16 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
if (!mb->type) { if (!mb->type) {
mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */ mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
} else { } else {
if (band->inherit_mv && ref_mb) { if (band->inherit_mv) {
/* motion vector inheritance */ if (ref_mb)
if (mv_scale) { /* motion vector inheritance */
mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); if (mv_scale) {
mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale); mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
} else { mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
mb->mv_x = ref_mb->mv_x; } else {
mb->mv_y = ref_mb->mv_y; mb->mv_x = ref_mb->mv_x;
} mb->mv_y = ref_mb->mv_y;
}
} else { } else {
/* decode motion vector deltas */ /* decode motion vector deltas */
mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table, mv_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment