[vlc-devel] [PATCH 4/7] opengl: fix memory leak in obscure PBO failure case

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 3 09:56:45 CEST 2018


Also seems unrelated to the patchset.
LGTM

On 01/10/2018 16:51, Niklas Haas wrote:
> From: Niklas Haas <git at haasn.xyz>
>
> This basically doesn't happen in practice, but we should correctly free
> the picture even in this failure path.
> ---
>   modules/video_output/opengl/converter_sw.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c
> index 4a839079b3..6338a1a5c0 100644
> --- a/modules/video_output/opengl/converter_sw.c
> +++ b/modules/video_output/opengl/converter_sw.c
> @@ -156,7 +156,10 @@ pbo_picture_create(const opengl_tex_converter_t *tc, bool direct_rendering)
>   
>           if( p->i_pitch < 0 || p->i_lines <= 0 ||
>               (size_t)p->i_pitch > SIZE_MAX/p->i_lines )
> +        {
> +            picture_Release(pic);
>               return NULL;
> +        }
>           picsys->bytes[i] = (p->i_pitch * p->i_lines) + 15 / 16 * 16;
>       }
>       return pic;
> -- 
> 2.19.0
>
> _______________________________________________
> 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