changeset 7924:926c3a5dcdd3 libavcodec

Ensure that no non-existing frame is used. Fixes issue624.
author michael
date Thu, 25 Sep 2008 19:25:28 +0000
parents 2c15748c530a
children 9dc65bb3bd3f
files error_resilience.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/error_resilience.c	Thu Sep 25 19:01:39 2008 +0000
+++ b/error_resilience.c	Thu Sep 25 19:25:28 2008 +0000
@@ -551,7 +551,7 @@
 static int is_intra_more_likely(MpegEncContext *s){
     int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y;
 
-    if(s->last_picture_ptr==NULL) return 1; //no previous frame available -> use spatial prediction
+    if(!s->last_picture_ptr || !s->last_picture_ptr->data[0]) return 1; //no previous frame available -> use spatial prediction
 
     undamaged_count=0;
     for(i=0; i<s->mb_num; i++){