error concealment: check last pictures motion_val before using it.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 12 May 2011 01:03:08 +0000 (03:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 12 May 2011 01:03:08 +0000 (03:03 +0200)
Fixes NULL pointer dereference.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/error_resilience.c

index dac5559..c9231e2 100644 (file)
@@ -381,7 +381,7 @@ static void guess_mv(MpegEncContext *s){
         fixed[mb_xy]= f;
         if(f==MV_FROZEN)
             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_x= mb_xy % s->mb_stride;
             const int mot_index= (mb_x + mb_y*mot_stride) * mot_step;