[vlc-commits] access: dvb: scan: check service descriptor

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr  7 14:03:58 2016 +0200| [497a3c5bdcbf057b78d250eb6ed213f3f3c69791] | committer: Francois Cartegnie

access: dvb: scan: check service descriptor

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

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

diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index 9430a90..7a9a7ef 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -728,13 +728,16 @@ static void SDTCallBack( scan_session_t *p_session, dvbpsi_sdt_t *p_sdt )
             if( p_dr->i_tag == 0x48 )
             {
                 dvbpsi_service_dr_t *pD = dvbpsi_DecodeServiceDr( p_dr );
-                char str2[257];
+                if( pD )
+                {
+                    char str2[257];
 
-                memcpy( str2, pD->i_service_name, pD->i_service_name_length );
-                str2[pD->i_service_name_length] = '\0';
+                    memcpy( str2, pD->i_service_name, pD->i_service_name_length );
+                    str2[pD->i_service_name_length] = '\0';
 
-                msg_Dbg( p_obj, "    - type=%d name=%s",
-                         pD->i_service_type, str2 );
+                    msg_Dbg( p_obj, "    - type=%d name=%s",
+                             pD->i_service_type, str2 );
+                }
             }
             else
             {
@@ -974,8 +977,7 @@ void scan_session_Destroy( scan_t *p_scan, scan_session_t *p_session )
                 if( p_dr->i_tag == 0x48 )
                 {
                     dvbpsi_service_dr_t *pD = dvbpsi_DecodeServiceDr( p_dr );
-
-                    if( s )
+                    if( s && pD )
                     {
                         if( !s->psz_name )
                             s->psz_name = vlc_from_EIT( pD->i_service_name,



More information about the vlc-commits mailing list