[vlc-commits] access: dvb: scan: remove pointer to stack var

Francois Cartegnie git at videolan.org
Sun Apr 10 13:56:11 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr  7 12:23:01 2016 +0200| [eb4d273854976600f23d67c7178cfa814e8bf4de] | committer: Francois Cartegnie

access: dvb: scan: remove pointer to stack var

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

 modules/access/dvb/scan.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index 92997a4..447d9e6 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -808,9 +808,8 @@ static void NITCallBack( scan_session_t *p_session, dvbpsi_nit_t *p_nit )
 
         uint32_t i_private_data_id = 0;
         dvbpsi_descriptor_t *p_dsc;
-        scan_configuration_t cfg, *p_cfg = &cfg;
+        scan_configuration_t cfg = { 0 };
 
-        memset(p_cfg,0,sizeof(*p_cfg));
         for( p_dsc = p_ts->p_first_descriptor; p_dsc != NULL; p_dsc = p_dsc->p_next )
         {
             if( p_dsc->i_tag == 0x41 )
@@ -824,7 +823,7 @@ static void NITCallBack( scan_session_t *p_session, dvbpsi_nit_t *p_nit )
                     if( (ScanFindService( p_scan, 0, i_service_id ) == NULL) &&
                          scan_service_type( i_service_type ) != SERVICE_UNKNOWN )
                     {
-                        scan_service_t *s = scan_service_New( i_service_id, p_cfg );
+                        scan_service_t *s = scan_service_New( i_service_id, &cfg );
                         if( likely(s) )
                         {
                             s->type          = scan_service_type( i_service_type );
@@ -853,12 +852,12 @@ static void NITCallBack( scan_session_t *p_session, dvbpsi_nit_t *p_nit )
                 dvbpsi_cable_deliv_sys_dr_t *p_t = dvbpsi_DecodeCableDelivSysDr( p_dsc );
                 msg_Dbg( p_obj, "       * Cable delivery system");
 
-                p_cfg->i_frequency =  decode_BCD( p_t->i_frequency ) * 100;
-                msg_Dbg( p_obj, "           * frequency %d", p_cfg->i_frequency );
-                p_cfg->i_symbolrate =  decode_BCD( p_t->i_symbol_rate ) * 100;
-                msg_Dbg( p_obj, "           * symbolrate %u", p_cfg->i_symbolrate );
-                p_cfg->i_modulation = (8 << p_t->i_modulation);
-                msg_Dbg( p_obj, "           * modulation %u", p_cfg->i_modulation );
+                cfg.i_frequency =  decode_BCD( p_t->i_frequency ) * 100;
+                msg_Dbg( p_obj, "           * frequency %d", cfg.i_frequency );
+                cfg.i_symbolrate =  decode_BCD( p_t->i_symbol_rate ) * 100;
+                msg_Dbg( p_obj, "           * symbolrate %u", cfg.i_symbolrate );
+                cfg.i_modulation = (8 << p_t->i_modulation);
+                msg_Dbg( p_obj, "           * modulation %u", cfg.i_modulation );
             }
             else if( p_dsc->i_tag == 0x5f )
             {



More information about the vlc-commits mailing list