From: Michael Niedermayer Date: Fri, 23 Mar 2012 10:03:53 +0000 (+0100) Subject: indeo4: check ref_mb X-Git-Tag: android-x86-4.4-r1~12821 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=aae44fb4cdfab4fae4d981d2fe1fd708f1dcf9bb;p=android-x86%2Fexternal-ffmpeg.git indeo4: check ref_mb Fix NULL deref Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index df80b1139e..1d280a0c53 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -517,7 +517,7 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band, } } } else { - if (band->inherit_mv) { + if (band->inherit_mv && ref_mb) { mb->type = ref_mb->type; /* copy mb_type from corresponding reference mb */ } else if (ctx->frame_type == FRAMETYPE_INTRA) { mb->type = 0; /* mb_type is always INTRA for intra-frames */