diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-29 02:34:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 22:40:58 +0100 |
commit | f246d46ee66678bdd23e939aaede28943cfeb8da (patch) | |
tree | 64949c2a95f88da476696d6aef0992c66e3a1b08 | |
parent | 94773637baad59c166a033ee2bc13afb661515e3 (diff) | |
download | ffmpeg-f246d46ee66678bdd23e939aaede28943cfeb8da.tar.gz |
indeo5: Fix null pointer dereferences of ref_mb
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f41a6c8f3aeb51332bb359038cb504d3fb562a52)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/indeo5.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 95bae2346a..983518838f 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -482,7 +482,7 @@ static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, } mb->mv_x = mb->mv_y = 0; /* no motion vector coded */ - if (band->inherit_mv){ + if (band->inherit_mv && ref_mb){ /* motion vector inheritance */ if (mv_scale) { mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); @@ -493,7 +493,7 @@ static int decode_mb_info(IVI5DecContext *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 */ @@ -519,7 +519,7 @@ static int decode_mb_info(IVI5DecContext *ctx, IVIBandDesc *band, if (!mb->type) { mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */ } else { - if (band->inherit_mv){ + if (band->inherit_mv && ref_mb){ /* motion vector inheritance */ if (mv_scale) { mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); |