Commit 5216245a authored by Michael Niedermayer's avatar Michael Niedermayer

indeo4: fix null ptr dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6bd97445
...@@ -519,7 +519,7 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band, ...@@ -519,7 +519,7 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band,
} }
mb->mv_x = mb->mv_y = 0; /* no motion vector coded */ mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
if (band->inherit_mv) { if (band->inherit_mv && ref_mb) {
/* motion vector inheritance */ /* motion vector inheritance */
if (mv_scale) { if (mv_scale) {
mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
...@@ -553,7 +553,7 @@ static int decode_mb_info(IVI4DecContext *ctx, IVIBandDesc *band, ...@@ -553,7 +553,7 @@ static int decode_mb_info(IVI4DecContext *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) { if (band->inherit_mv && ref_mb) {
/* motion vector inheritance */ /* motion vector inheritance */
if (mv_scale) { if (mv_scale) {
mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale); mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
......
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