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

Luca Barbato lu_zero at gentoo.org
Sun Jan 28 10:59:28 CET 2018


On 28/01/2018 03:24, Sean McGovern wrote:
> 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;
> 

You should check for s->last_picture.f->data[0] outside the loop.

Look at ff_vc1_mc_4mv_chroma(), probably the same check does apply.

lu


More information about the libav-devel mailing list