[vlc-commits] decoder: fix type aliasing violation

Rémi Denis-Courmont git at videolan.org
Sun Apr 14 16:02:46 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 14 17:02:00 2019 +0300| [1a350d8db195f26fe6cdd389fa846364b15a602e] | committer: Rémi Denis-Courmont

decoder: fix type aliasing violation

In file included from ../../include/vlc_common.h:1190,
                 from ../../src/input/decoder_helpers.c:29:
../../src/input/decoder_helpers.c: In function ‘vlc_decoder_device_Create’:
../../include/vlc_modules.h:70:47: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             vlc_module_load(vlc_object_logger((vlc_object_t *)(ctx)), cap, \
../../include/vlc_objects.h:64:15: note: in definition of macro ‘VLC_OBJECT’
     _Generic((x)->obj, \
               ^
../../include/vlc_modules.h:70:29: note: in expansion of macro ‘vlc_object_logger’
             vlc_module_load(vlc_object_logger((vlc_object_t *)(ctx)), cap, \
                             ^~~~~~~~~~~~~~~~~
../../src/input/decoder_helpers.c:135:20: note: in expansion of macro ‘vlc_module_load’
     priv->module = vlc_module_load(&priv->device, "decoder device", name,
                    ^~~~~~~~~~~~~~~

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

 src/input/decoder_helpers.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 3d1c574cb7..298eacafed 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -132,9 +132,9 @@ vlc_decoder_device_Create(vout_window_t *window)
     if (!priv)
         return NULL;
     char *name = var_InheritString(window, "dec-dev");
-    priv->module = vlc_module_load(&priv->device, "decoder device", name,
-                                    true, decoder_device_Open, &priv->device,
-                                    window);
+    priv->module = vlc_module_load(priv, "decoder device", name,
+                                   true, decoder_device_Open, &priv->device,
+                                   window);
     free(name);
     if (!priv->module)
     {



More information about the vlc-commits mailing list