vaapi: libs: Use unsized arrays as parameters.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 16 Nov 2021 16:18:28 +0000 (17:18 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 18 Nov 2021 07:32:26 +0000 (07:32 +0000)
Instead of defining a sized array for function signature, use it
unsized (a pointer alias, basically). In this way clang warning is
silenced:

warning: ‘fill_profiles’ accessing 64 bytes in a region of size 12 [-Wstringop-overflow=]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1357>

subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c

index 01b1797..490528c 100644 (file)
@@ -1435,7 +1435,7 @@ get_sps (GstVaapiDecoderH264 * decoder)
 }
 
 static void
-fill_profiles (GstVaapiProfile profiles[16], guint * n_profiles_ptr,
+fill_profiles (GstVaapiProfile profiles[], guint * n_profiles_ptr,
     GstVaapiProfile profile)
 {
   guint n_profiles = *n_profiles_ptr;
@@ -1453,7 +1453,7 @@ fill_profiles (GstVaapiProfile profiles[16], guint * n_profiles_ptr,
 
 /* Fills in compatible profiles for MVC decoding */
 static void
-fill_profiles_mvc (GstVaapiDecoderH264 * decoder, GstVaapiProfile profiles[16],
+fill_profiles_mvc (GstVaapiDecoderH264 * decoder, GstVaapiProfile profiles[],
     guint * n_profiles_ptr, guint dpb_size)
 {
   const gchar *const vendor_string =
index ad25888..218a25b 100644 (file)
@@ -1073,7 +1073,7 @@ gst_vaapi_decoder_h265_reset (GstVaapiDecoder * base_decoder)
 }
 
 static void
-fill_profiles (GstVaapiProfile profiles[16], guint * n_profiles_ptr,
+fill_profiles (GstVaapiProfile profiles[], guint * n_profiles_ptr,
     GstVaapiProfile profile)
 {
   guint n_profiles = *n_profiles_ptr;