1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-21 08:45:06 +02:00

error concealment: check last pictures motion_val before using it.

Fixes NULL pointer dereference.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-05-12 03:03:08 +02:00
parent 1cafc23288
commit b8a4b0152a

View File

@ -381,7 +381,7 @@ static void guess_mv(MpegEncContext *s){
fixed[mb_xy]= f; fixed[mb_xy]= f;
if(f==MV_FROZEN) if(f==MV_FROZEN)
num_avail++; num_avail++;
else if(s->last_picture.data[0]){ else if(s->last_picture.data[0] && s->last_picture.motion_val[0]){
const int mb_y= mb_xy / s->mb_stride; const int mb_y= mb_xy / s->mb_stride;
const int mb_x= mb_xy % s->mb_stride; const int mb_x= mb_xy % s->mb_stride;
const int mot_index= (mb_x + mb_y*mot_stride) * mot_step; const int mot_index= (mb_x + mb_y*mot_stride) * mot_step;