[FFmpeg-devel] [PATCH] area changed:in cfhd height initialization was buggy for chroma plane

Carl Eugen Hoyos ceffmpeg at gmail.com
Tue Mar 20 01:54:53 EET 2018


2018-03-16 11:27 GMT+01:00, Gagandeep Singh <deepgagan231197 at gmail.com>:
> From: Gagandeep Singh <sunsingh at iitk.ac.in>

> diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> index fd5555834b..a064cd1599 100644
> --- a/libavcodec/cfhd.c
> +++ b/libavcodec/cfhd.c
> @@ -195,14 +195,14 @@ static int alloc_buffers(AVCodecContext *avctx)
>          int w8, h8, w4, h4, w2, h2;
>          int width  = i ? avctx->width  >> chroma_x_shift : avctx->width;
>          int height = i ? avctx->height >> chroma_y_shift : avctx->height;
> -        ptrdiff_t stride = FFALIGN(width  / 8, 8) * 8;
> -        height           = FFALIGN(height / 8, 2) * 8;
> +        ptrdiff_t stride           = FFALIGN(width  / 8, 8) * 8;
> +        if (chroma_y_shift) height = FFALIGN(height / 8, 2) * 8;
>          s->plane[i].width  = width;
>          s->plane[i].height = height;
>          s->plane[i].stride = stride;
>
>          w8 = FFALIGN(s->plane[i].width  / 8, 8);
> -        h8 = FFALIGN(s->plane[i].height / 8, 2);
> +        h8 = height / 8;

In addition to what was already discussed, this
patch "breaks" fate (it is of course our mistake
to use a broken test but you still have to fix the
issue now).

Carl Eugen


More information about the ffmpeg-devel mailing list