if( p_index->i_index_entry_count > (p_index->i_object_size - 56) / 6 )
p_index->i_index_entry_count = (p_index->i_object_size - 56) / 6;
- p_index->index_entry = malloc( sizeof(asf_index_entry_t) *
- p_index->i_index_entry_count );
+ p_index->index_entry = calloc( p_index->i_index_entry_count,
+ sizeof(asf_index_entry_t) );
for( i = 0, p_peek += 56; i < (int)p_index->i_index_entry_count;
i++, p_peek += 6 )
codec.i_type = GetWLE( p_data ); p_data += 2;
/* codec name */
i_len = GetWLE( p_data ); p_data += 2;
- codec.psz_name = calloc( sizeof( char ), i_len + 1);
+ codec.psz_name = calloc( i_len + 1, sizeof(char) );
for( i = 0; i < i_len; i++ )
{
codec.psz_name[i] = GetWLE( p_data + 2*i );
/* description */
i_len = GetWLE( p_data ); p_data += 2;
- codec.psz_description = calloc( sizeof( char ), i_len + 1);
+ codec.psz_description = calloc( i_len + 1, sizeof(char) );
for( i = 0; i < i_len; i++ )
{
codec.psz_description[i] = GetWLE( p_data + 2*i );
int i_size = *p_data++;
int i_len;
- psz = calloc( i_size/2 + 1, sizeof( char ) );
+ psz = calloc( i_size/2 + 1, sizeof(char) );
for( i_len = 0; i_len < i_size/2; i_len++ )
{
psz[i_len] = GetWLE( p_data + 2*i_len );
p_data += 64;
- p_esp->pi_stream_name_language = calloc( sizeof(int),
- p_esp->i_stream_name_count );
- p_esp->ppsz_stream_name = calloc( sizeof(char*),
- p_esp->i_stream_name_count );
+ p_esp->pi_stream_name_language = calloc( p_esp->i_stream_name_count,
+ sizeof(int) );
+ p_esp->ppsz_stream_name = calloc( p_esp->i_stream_name_count,
+ sizeof(char*) );
for( i = 0; i < p_esp->i_stream_name_count; i++ )
{
int i_size;
i_size = GetWLE( &p_data[2] );
p_data += 2;
- psz = calloc( i_size/2 + 1, sizeof( char ) );
+ psz = calloc( i_size/2 + 1, sizeof(char) );
for( i_len = 0; i_len < i_size/2; i_len++ )
{
psz[i_len] = GetWLE( p_data + 2*i_len );
p_ae->i_stream_number_count = GetWLE( &p_data[16] );
p_data += 16 + 2;
- p_ae->pi_stream_number = calloc( sizeof(int),
- p_ae->i_stream_number_count );
+ p_ae->pi_stream_number = calloc( p_ae->i_stream_number_count,
+ sizeof(int) );
for( i = 0; i < p_ae->i_stream_number_count; i++ )
{
p_ae->pi_stream_number[i] = GetWLE( p_data );
p_sp->i_priority_count = GetWLE( &p_data[0] );
p_data += 2;
- p_sp->pi_priority_flag = calloc( sizeof(int), p_sp->i_priority_count );
+ p_sp->pi_priority_flag = calloc( p_sp->i_priority_count, sizeof(int) );
p_sp->pi_priority_stream_number =
- calloc( sizeof(int), p_sp->i_priority_count );
+ calloc( p_sp->i_priority_count, sizeof(int) );
for( i = 0; i < p_sp->i_priority_count; i++ )
{
p_data = &p_peek[24];
p_ec->i_count = GetWLE( p_data ); p_data += 2;
- p_ec->ppsz_name = calloc( sizeof(char*), p_ec->i_count );
- p_ec->ppsz_value = calloc( sizeof(char*), p_ec->i_count );
+ p_ec->ppsz_name = calloc( p_ec->i_count, sizeof(char*) );
+ p_ec->ppsz_value = calloc( p_ec->i_count, sizeof(char*) );
for( i = 0; i < p_ec->i_count; i++ )
{
int i_size;