[vlc-commits] amem: fix conditionally unitialized cleanup callback

Rémi Denis-Courmont git at videolan.org
Sun Jun 30 18:14:26 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 30 19:13:37 2013 +0300| [aa55e81c32958ec698ddb28a250b177d32576625] | committer: Rémi Denis-Courmont

amem: fix conditionally unitialized cleanup callback

(cherry picked from commit d4a0c69dc3635ac6d7d82e34b26de9ddecc9dbbb)

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

 modules/audio_output/amem.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/amem.c b/modules/audio_output/amem.c
index 0296fc4..5e55ef6 100644
--- a/modules/audio_output/amem.c
+++ b/modules/audio_output/amem.c
@@ -56,12 +56,12 @@ struct aout_sys_t
 {
     void *opaque;
     int (*setup) (void **, char *, unsigned *, unsigned *);
+    void (*cleanup) (void *opaque);
     union
     {
         struct
         {
             void *setup_opaque;
-            void (*cleanup) (void *opaque);
         };
         struct
         {
@@ -243,11 +243,12 @@ static int Open (vlc_object_t *obj)
     sys->setup = var_InheritAddress (obj, "amem-setup");
     if (sys->setup != NULL)
     {
-        sys->setup_opaque = opaque;
         sys->cleanup = var_InheritAddress (obj, "amem-cleanup");
+        sys->setup_opaque = opaque;
     }
     else
     {
+        sys->cleanup = NULL;
         sys->opaque = opaque;
         sys->rate = var_InheritInteger (obj, "amem-rate");
         sys->channels = var_InheritInteger (obj, "amem-channels");



More information about the vlc-commits mailing list