avcodec/mpegvideo_motion: Check P field references
If a reference is unavailable use a field from the current picture Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 23daee0dcc57b647b9d62d4c905e94acf0c6b8e0) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a92b73da99
commit
a2186a8054
@ -812,7 +812,8 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
|
||||
s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);
|
||||
}
|
||||
} else {
|
||||
if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field){
|
||||
if( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field
|
||||
|| !ref_picture[0]){
|
||||
ref_picture = s->current_picture_ptr->f.data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user