[vlc-commits] vdr: fix callback init order

Rémi Denis-Courmont git at videolan.org
Tue Feb 21 22:09:26 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 21 23:07:20 2017 +0200| [1f2dc9782432fe9229ea89d735b96af3d5f550ef] | committer: Rémi Denis-Courmont

vdr: fix callback init order

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

 modules/access/vdr.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index 70e3b1e..81b549c 100644
--- a/modules/access/vdr.c
+++ b/modules/access/vdr.c
@@ -188,8 +188,12 @@ static int Open( vlc_object_t *p_this )
         !S_ISDIR( st.st_mode ) )
         return VLC_EGENERIC;
 
-    access_sys_t *p_sys;
-    STANDARD_READ_ACCESS_INIT;
+    access_sys_t *p_sys = calloc( 1, sizeof( *p_sys ) );
+
+    if( unlikely(p_sys == NULL) )
+        return VLC_ENOMEM;
+
+    p_access->p_sys = p_sys;
     p_sys->fd = -1;
     p_sys->cur_seekpoint = 0;
     p_sys->fps = var_InheritFloat( p_access, "vdr-fps" );
@@ -203,6 +207,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek );
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list