Commit 7b8c5b26 authored by Vladimir Pantelic's avatar Vladimir Pantelic Committed by Luca Barbato

vc1dec: prevent a crash due missing pred_flag parameter

Handle pred_flag parameter not given to get_mvdata_interlaced()
Signed-off-by: 's avatarVladimir Pantelic <vladoman@gmail.com>
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent ae3d4163
......@@ -1133,8 +1133,12 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x,
*dmv_x = get_bits(gb, v->k_x);
*dmv_y = get_bits(gb, v->k_y);
if (v->numref) {
*pred_flag = *dmv_y & 1;
*dmv_y = (*dmv_y + *pred_flag) >> 1;
if (pred_flag) {
*pred_flag = *dmv_y & 1;
*dmv_y = (*dmv_y + *pred_flag) >> 1;
} else {
*dmv_y = (*dmv_y + (*dmv_y & 1)) >> 1;
}
}
}
else {
......@@ -1160,7 +1164,7 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x,
*dmv_y = (sign ^ ((val >> 1) + offs_tab[index1 >> v->numref])) - sign;
} else
*dmv_y = 0;
if (v->numref)
if (v->numref && pred_flag)
*pred_flag = index1 & 1;
}
}
......
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