Commit 91bf0f04 authored by Rémi Duraffort's avatar Rémi Duraffort

calloc( nb_elmnt, size ) instead of calloc( size, nb_elmnt )

parent 524810e6
......@@ -433,8 +433,8 @@ static int ConfigureV4L2( access_t * p_access )
controls.reserved[0] = 0;
controls.reserved[1] = 0;
controls.count = 0;
controls.controls = calloc( sizeof( struct v4l2_ext_control ),
MAX_V4L2_CTRLS );
controls.controls = calloc( MAX_V4L2_CTRLS,
sizeof( struct v4l2_ext_control ) );
if( controls.controls == NULL )
return VLC_ENOMEM;
......
......@@ -397,7 +397,7 @@ static int OpenAudio( decoder_t *p_dec )
/* get lock, avoid segfault */
vlc_mutex_lock( &qt_mutex );
p_sys = calloc( sizeof( decoder_sys_t ), 1 );
p_sys = calloc( 1, sizeof( decoder_sys_t ) );
p_dec->p_sys = p_sys;
p_dec->pf_decode_audio = DecodeAudio;
......
......@@ -584,7 +584,7 @@ static int Open( vlc_object_t * p_this )
{
const uint8_t *p_pal = fmt.p_extra;
fmt.video.p_palette = calloc( sizeof(video_palette_t), 1 );
fmt.video.p_palette = calloc( 1, sizeof(video_palette_t) );
fmt.video.p_palette->i_entries = __MIN(fmt.i_extra/4, 256);
for( int i = 0; i < fmt.video.p_palette->i_entries; i++ )
......
......@@ -513,7 +513,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count = __MIN( p_indx->i_entriesinuse, i_read / 8 );
p_indx->i_entriesinuse = i_count;
p_indx->idx.std = calloc( sizeof( indx_std_entry_t ), i_count );
p_indx->idx.std = calloc( i_count, sizeof( indx_std_entry_t ) );
for( i = 0; i < i_count; i++ )
{
......@@ -528,7 +528,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count = __MIN( p_indx->i_entriesinuse, i_read / 12 );
p_indx->i_entriesinuse = i_count;
p_indx->idx.field = calloc( sizeof( indx_field_entry_t ), i_count );
p_indx->idx.field = calloc( i_count, sizeof( indx_field_entry_t ) );
for( i = 0; i < i_count; i++ )
{
AVI_READ4BYTES( p_indx->idx.field[i].i_offset );
......@@ -545,7 +545,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count = __MIN( p_indx->i_entriesinuse, i_read / 16 );
p_indx->i_entriesinuse = i_count;
p_indx->idx.super = calloc( sizeof( indx_super_entry_t ), i_count );
p_indx->idx.super = calloc( i_count, sizeof( indx_super_entry_t ) );
for( i = 0; i < i_count; i++ )
{
......
......@@ -106,7 +106,7 @@ static int Open( vlc_object_t *p_this )
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys;
p_sys = p_intf->p_sys = calloc( sizeof(intf_sys_t), 1);
p_sys = p_intf->p_sys = calloc( 1, sizeof(intf_sys_t) );
if( !p_sys )
return VLC_ENOMEM;
......
......@@ -140,7 +140,7 @@ static int CreateVout( vlc_object_t *p_this )
char * psz;
/* Allocate structure */
p_vout->p_sys = p_sys = calloc( sizeof( vout_sys_t ), 1 );
p_vout->p_sys = p_sys = calloc( 1, sizeof( vout_sys_t ) );
if( p_sys == NULL )
return VLC_EGENERIC;
......
......@@ -141,7 +141,7 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
p_new->i_flags = p_this->i_flags
& (OBJECT_FLAGS_NODBG|OBJECT_FLAGS_QUIET|OBJECT_FLAGS_NOINTERACT);
p_priv->p_vars = calloc( sizeof( variable_t ), 16 );
p_priv->p_vars = calloc( 16, sizeof( variable_t ) );
if( !p_priv->p_vars )
{
......
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