]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/error_resilience.c
Add memory allocation failure checks to ff_iir_filter_init_coeffs().
[ffmpeg] / libavcodec / error_resilience.c
index fffe19cca3294d8299f28d961f23dff13bce5b67..dc015b9f6af63beb30528b32044ca0d3e9b7a51e 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 /**
- * @file libavcodec/error_resilience.c
+ * @file
  * Error resilience / concealment.
  */
 
@@ -31,6 +31,7 @@
 #include "dsputil.h"
 #include "mpegvideo.h"
 #include "h264.h"
+#include "rectangle.h"
 
 /*
  * H264 redefines mb_intra so it is not mistakely used (its uninitialized in h264)
@@ -629,6 +630,12 @@ static int is_intra_more_likely(MpegEncContext *s){
             undamaged_count++;
     }
 
+    if(s->codec_id == CODEC_ID_H264){
+        H264Context *h= (void*)s;
+        if(h->ref_count[0] <= 0 || !h->ref_list[0][0].data[0])
+            return 1;
+    }
+
     if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction
 
     //prevent dsp.sad() check, that requires access to the image