aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/error_resilience.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-12 03:03:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-12 03:03:08 +0200
commitb8a4b0152a3a697e03fd28458098a514fcdee5d3 (patch)
tree2b223825c4014c4173d27971326ae42ac1cc131f /libavcodec/error_resilience.c
parent1cafc23288b9d860b9f309c86a5f148b73c07270 (diff)
downloadffmpeg-b8a4b0152a3a697e03fd28458098a514fcdee5d3.tar.gz
error concealment: check last pictures motion_val before using it.
Fixes NULL pointer dereference. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/error_resilience.c')
-rw-r--r--libavcodec/error_resilience.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index dac555909b..c9231e206f 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -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;