[vlc-commits] access: dvb: scan: rewrite oom condition
Francois Cartegnie
git at videolan.org
Tue May 3 18:45:41 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 28 16:22:23 2016 +0200| [f780140198431eb33367ac51862ed95eddfd4176] | committer: Francois Cartegnie
access: dvb: scan: rewrite oom condition
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f780140198431eb33367ac51862ed95eddfd4176
---
modules/access/dvb/scan.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index d700a92..245466e 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -1271,19 +1271,19 @@ static void ParseNIT( vlc_object_t *p_obj, scan_t *p_scan,
if( s == NULL )
{
s = scan_service_New( i_service_id );
- if( likely(s) )
+ if( unlikely(s == NULL) )
+ continue;
+
+ s->type = i_service_type;
+ s->i_original_network_id = p_ts->i_orig_network_id;
+ if( !scan_multiplex_AddService( p_mplex, s ) )
{
- s->type = i_service_type;
- s->i_original_network_id = p_ts->i_orig_network_id;
- if( !scan_multiplex_AddService( p_mplex, s ) )
- {
- scan_service_Delete( s );
- s = NULL;
- }
+ scan_service_Delete( s );
+ s = NULL;
}
}
- if ( s && s->psz_original_network_name == NULL && p_nn )
+ if ( s->psz_original_network_name == NULL && p_nn )
s->psz_original_network_name = strndup( (const char*) p_nn->p_data, p_dsc->i_length );
}
More information about the vlc-commits
mailing list