[vlc-commits] opengl: vaapi: silence strncpy warning

Alexandre Janniaux git at videolan.org
Wed Sep 25 10:54:16 CEST 2019


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Sep 24 17:42:50 2019 +0200| [e4e78633c115b782c3186d4c3a751f24a879e40e] | committer: Thomas Guillem

opengl: vaapi: silence strncpy warning

Silence -Wstringop-truncation warning.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e4e78633c115b782c3186d4c3a751f24a879e40e
---

 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 504969f4da..144c3d940c 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),



More information about the vlc-commits mailing list