[libav-devel] [PATCH] vc1: skip motion compensation when data for last picture is invalid

Sean McGovern gseanmcg at gmail.com
Sun Jan 28 17:46:43 CET 2018


Bug-Id: 1101
Cc: libav-stable at libav.org
---
 libavcodec/vc1_mc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
index f4632d6..abdc9e3 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -689,6 +689,11 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int
dir, int dir2, int avg)
     if (s->avctx->flags & AV_CODEC_FLAG_GRAY)
         return;

+    if (s->last_picture.f && !s->last_picture.f->data[1]) {
+      av_log(s->avctx, AV_LOG_ERROR, "Bad data in last picture frame.\n");
+      return;
+    }
+
     for (i = 0; i < 4; i++) {
         int d = i < 2 ? dir: dir2;
         tx = s->mv[d][i][0];
-- 
2.7.4


More information about the libav-devel mailing list