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

Sean McGovern gseanmcg at gmail.com
Sun Jan 28 03:24: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..fb5ca75 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -713,6 +713,11 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
             lutuv  = v->next_lutuv;
             use_ic = v->next_use_ic;
         } else {
+            if (!s->last_picture.f->data[1]) {
+              av_log(s->avctx, AV_LOG_WARNING, "Bad data in last picture frame.\n");
+              return;
+            }
+
             srcU = s->last_picture.f->data[1] + uvsrc_y * s->uvlinesize + uvsrc_x;
             srcV = s->last_picture.f->data[2] + uvsrc_y * s->uvlinesize + uvsrc_x;
             lutuv  = v->last_lutuv;
-- 
2.7.4



More information about the libav-stable mailing list