[FFmpeg-devel] [PATCH 07/16] eamad: avoid NULL derefence when missing the reference frame.

fenrir at elivagar.org fenrir at elivagar.org
Sat Oct 8 23:40:32 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

---
 libavcodec/eamad.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 83a91ac..dfcdb2e 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -211,7 +211,8 @@ static void decode_mb(MadContext *t, int inter)
     for (j=0; j<6; j++) {
         if (mv_map & (1<<j)) {  // mv_x and mv_y are guarded by mv_map
             int add = 2*decode_motion(&s->gb);
-            comp_block(t, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
+            if (t->last_frame.data[0])
+                comp_block(t, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
         } else {
             s->dsp.clear_block(t->block);
             decode_block_intra(t, t->block);
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list