[FFmpeg-cvslog] error concealment: check that references are frames and not fields.

Michael Niedermayer git at videolan.org
Mon Nov 19 00:39:56 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 18 22:51:54 2012 +0100| [e8fed4d3314cdf0cf4134844a1acf5798b205cb8] | committer: Michael Niedermayer

error concealment: check that references are frames and not fields.

frames cant have field references.
Fixes a deadlock

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8fed4d3314cdf0cf4134844a1acf5798b205cb8
---

 libavcodec/error_resilience.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 7ddc5ac..01f7424 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -66,6 +66,10 @@ static void decode_mb(MpegEncContext *s, int ref)
             av_log(s->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n");
             ref = 0;
         }
+        if ((h->ref_list[0][ref].f.reference&3) != 3) {
+            av_log(s->avctx, AV_LOG_DEBUG, "Reference invalid\n");
+            return;
+        }
         fill_rectangle(&s->current_picture.f.ref_index[0][4 * h->mb_xy],
                        2, 2, 2, ref, 1);
         fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);



More information about the ffmpeg-cvslog mailing list