[vlc-devel] [PATCH] opengl: vaapi: silence strncpy warning
Steve Lhomme
robux4 at ycbcr.xyz
Tue Sep 24 17:53:42 CEST 2019
LGTM
On 2019-09-24 17:42, Alexandre Janniaux wrote:
> Silence -Wstringop-truncation warning.
> ---
> modules/video_output/opengl/converter_vaapi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
> index 504969f4da8..144c3d940c1 100644
> --- a/modules/video_output/opengl/converter_vaapi.c
> +++ b/modules/video_output/opengl/converter_vaapi.c
> @@ -310,8 +310,8 @@ tc_va_check_interop_blacklist(opengl_tex_converter_t *tc, VADisplay *vadpy)
> };
>
> char vendor_prefix[BL_SIZE_MAX];
> - strncpy(vendor_prefix, vendor, BL_SIZE_MAX);
> - vendor_prefix[BL_SIZE_MAX - 1] = '\0';
> + strncpy(vendor_prefix, vendor, sizeof(vendor_prefix) - 1);
> + vendor_prefix[sizeof(vendor_prefix) - 1] = '\0';
>
> const char *found = bsearch(vendor_prefix, blacklist_prefix,
> ARRAY_SIZE(blacklist_prefix),
> --
> 2.23.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