[vlc-devel] [PATCH 4/4] picture: do not lose the last U/V lines for 4:2:0 chromas
Tristan Matthews
tmatth at videolan.org
Tue Apr 17 16:42:47 CEST 2018
Hi,
On Tue, Apr 17, 2018 at 9:02 AM, Steve Lhomme <robux4 at ycbcr.xyz> wrote:
> Fixes #20290
This also fixes a division by zero I just hit for a 1x1 y4m video in
video_output/opengl/converter_sw.c:
http://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_output/opengl/converter_sw.c;h=0d8727b274a122b24623cbc7ec16be250ab31975;hb=HEAD#l329
where pic->p[1].i_visible_pitch is 0.
> ---
> src/misc/picture.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index 8608e552e0..02d61160d7 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -159,10 +159,10 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
> assert(p_dsc->plane_count == 2 || w->den >= w->num);
>
> p->i_lines = height * h->num / h->den;
> - p->i_visible_lines = fmt->i_visible_height * h->num / h->den;
> + p->i_visible_lines = (fmt->i_visible_height + (h->den - 1)) * h->num / h->den;
>
> p->i_pitch = width * w->num / w->den * p_dsc->pixel_size;
> - p->i_visible_pitch = fmt->i_visible_width * w->num / w->den
> + p->i_visible_pitch = (fmt->i_visible_width + (w->den - 1)) * w->num / w->den
> * p_dsc->pixel_size;
> p->i_pixel_pitch = p_dsc->pixel_size;
>
> --
> 2.16.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list