Commit 997feb29 authored by Rafaël Carré's avatar Rafaël Carré

v4l2: replaces bad malloc( sizeof(x) * i )/memset(&, 0, sizeof(x)) by calloc(1, sizeof(x) * i)

removes extra spaces, removes tabs
parent a2157f6e
......@@ -276,9 +276,8 @@ static int Open( vlc_object_t *p_this )
p_demux->info.i_title = 0;
p_demux->info.i_seekpoint = 0;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
if( p_sys == NULL ) return VLC_ENOMEM;
memset( p_sys, 0, sizeof( demux_sys_t ) );
p_sys->i_video_pts = -1;
......@@ -1538,9 +1537,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
p_sys->i_input++;
}
p_sys->p_inputs = malloc( p_sys->i_input * sizeof( struct v4l2_input ) );
p_sys->p_inputs = calloc( 1, p_sys->i_input * sizeof( struct v4l2_input ) );
if( !p_sys->p_inputs ) goto open_failed;
memset( p_sys->p_inputs, 0, sizeof( struct v4l2_input ) );
for( i_index = 0; i_index < p_sys->i_input; i_index++ )
{
......@@ -1572,9 +1570,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
t_standards.index = p_sys->i_standard;
}
p_sys->p_standards = malloc( p_sys->i_standard * sizeof( struct v4l2_standard ) );
p_sys->p_standards = calloc( 1, p_sys->i_standard * sizeof( struct v4l2_standard ) );
if( !p_sys->p_standards ) goto open_failed;
memset( p_sys->p_standards, 0, sizeof( struct v4l2_standard ) );
for( i_standard = 0; i_standard < p_sys->i_standard; i_standard++ )
{
......@@ -1632,9 +1629,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
tuner.index = p_sys->i_tuner;
}
p_sys->p_tuners = malloc( p_sys->i_tuner * sizeof( struct v4l2_tuner ) );
p_sys->p_tuners = calloc( 1, p_sys->i_tuner * sizeof( struct v4l2_tuner ) );
if( !p_sys->p_tuners ) goto open_failed;
memset( p_sys->p_tuners, 0, sizeof( struct v4l2_tuner ) );
for( i_index = 0; i_index < p_sys->i_tuner; i_index++ )
{
......@@ -1681,8 +1677,7 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
p_sys->i_codec = i_index;
p_sys->p_codecs = malloc( p_sys->i_codec * sizeof( struct v4l2_fmtdesc ) );
memset( p_sys->p_codecs, 0, p_sys->i_codec * sizeof( struct v4l2_fmtdesc ) );
p_sys->p_codecs = calloc( 1, p_sys->i_codec * sizeof( struct v4l2_fmtdesc ) );
for( i_index = 0; i_index < p_sys->i_codec; i_index++ )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment