Changeset 1308862fa104b6419c5656d75f14fbc1b711c8ae
- Timestamp:
- 07/02/08 21:57:30
(2 months ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1215028650 +0000
- git-parent:
[ccb8128c8e6d6982f4b89636b599f2332e6b5fb6]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1215018179 +0000
- Message:
Use calloc when appropriate + cosmetics.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rb1285be |
r1308862 |
|
| 246 | 246 | p_index->i_index_entry_count = (p_index->i_object_size - 56) / 6; |
|---|
| 247 | 247 | |
|---|
| 248 | | p_index->index_entry = malloc( sizeof(asf_index_entry_t) * |
|---|
| 249 | | p_index->i_index_entry_count ); |
|---|
| | 248 | p_index->index_entry = calloc( p_index->i_index_entry_count, |
|---|
| | 249 | sizeof(asf_index_entry_t) ); |
|---|
| 250 | 250 | |
|---|
| 251 | 251 | for( i = 0, p_peek += 56; i < (int)p_index->i_index_entry_count; |
|---|
| … | … | |
| 632 | 632 | /* codec name */ |
|---|
| 633 | 633 | i_len = GetWLE( p_data ); p_data += 2; |
|---|
| 634 | | codec.psz_name = calloc( sizeof( char ), i_len + 1); |
|---|
| | 634 | codec.psz_name = calloc( i_len + 1, sizeof(char) ); |
|---|
| 635 | 635 | for( i = 0; i < i_len; i++ ) |
|---|
| 636 | 636 | { |
|---|
| … | … | |
| 642 | 642 | /* description */ |
|---|
| 643 | 643 | i_len = GetWLE( p_data ); p_data += 2; |
|---|
| 644 | | codec.psz_description = calloc( sizeof( char ), i_len + 1); |
|---|
| | 644 | codec.psz_description = calloc( i_len + 1, sizeof(char) ); |
|---|
| 645 | 645 | for( i = 0; i < i_len; i++ ) |
|---|
| 646 | 646 | { |
|---|
| … | … | |
| 808 | 808 | int i_len; |
|---|
| 809 | 809 | |
|---|
| 810 | | psz = calloc( i_size/2 + 1, sizeof( char ) ); |
|---|
| | 810 | psz = calloc( i_size/2 + 1, sizeof(char) ); |
|---|
| 811 | 811 | for( i_len = 0; i_len < i_size/2; i_len++ ) |
|---|
| 812 | 812 | { |
|---|
| … | … | |
| 912 | 912 | p_data += 64; |
|---|
| 913 | 913 | |
|---|
| 914 | | p_esp->pi_stream_name_language = calloc( sizeof(int), |
|---|
| 915 | | p_esp->i_stream_name_count ); |
|---|
| 916 | | p_esp->ppsz_stream_name = calloc( sizeof(char*), |
|---|
| 917 | | p_esp->i_stream_name_count ); |
|---|
| | 914 | p_esp->pi_stream_name_language = calloc( p_esp->i_stream_name_count, |
|---|
| | 915 | sizeof(int) ); |
|---|
| | 916 | p_esp->ppsz_stream_name = calloc( p_esp->i_stream_name_count, |
|---|
| | 917 | sizeof(char*) ); |
|---|
| 918 | 918 | for( i = 0; i < p_esp->i_stream_name_count; i++ ) |
|---|
| 919 | 919 | { |
|---|
| … | … | |
| 926 | 926 | p_data += 2; |
|---|
| 927 | 927 | |
|---|
| 928 | | psz = calloc( i_size/2 + 1, sizeof( char ) ); |
|---|
| | 928 | psz = calloc( i_size/2 + 1, sizeof(char) ); |
|---|
| 929 | 929 | for( i_len = 0; i_len < i_size/2; i_len++ ) |
|---|
| 930 | 930 | { |
|---|
| … | … | |
| 1024 | 1024 | |
|---|
| 1025 | 1025 | p_data += 16 + 2; |
|---|
| 1026 | | p_ae->pi_stream_number = calloc( sizeof(int), |
|---|
| 1027 | | p_ae->i_stream_number_count ); |
|---|
| | 1026 | p_ae->pi_stream_number = calloc( p_ae->i_stream_number_count, |
|---|
| | 1027 | sizeof(int) ); |
|---|
| 1028 | 1028 | for( i = 0; i < p_ae->i_stream_number_count; i++ ) |
|---|
| 1029 | 1029 | { |
|---|
| … | … | |
| 1065 | 1065 | p_data += 2; |
|---|
| 1066 | 1066 | |
|---|
| 1067 | | p_sp->pi_priority_flag = calloc( sizeof(int), p_sp->i_priority_count ); |
|---|
| | 1067 | p_sp->pi_priority_flag = calloc( p_sp->i_priority_count, sizeof(int) ); |
|---|
| 1068 | 1068 | p_sp->pi_priority_stream_number = |
|---|
| 1069 | | calloc( sizeof(int), p_sp->i_priority_count ); |
|---|
| | 1069 | calloc( p_sp->i_priority_count, sizeof(int) ); |
|---|
| 1070 | 1070 | |
|---|
| 1071 | 1071 | for( i = 0; i < p_sp->i_priority_count; i++ ) |
|---|
| … | … | |
| 1108 | 1108 | |
|---|
| 1109 | 1109 | p_ec->i_count = GetWLE( p_data ); p_data += 2; |
|---|
| 1110 | | p_ec->ppsz_name = calloc( sizeof(char*), p_ec->i_count ); |
|---|
| 1111 | | p_ec->ppsz_value = calloc( sizeof(char*), p_ec->i_count ); |
|---|
| | 1110 | p_ec->ppsz_name = calloc( p_ec->i_count, sizeof(char*) ); |
|---|
| | 1111 | p_ec->ppsz_value = calloc( p_ec->i_count, sizeof(char*) ); |
|---|
| 1112 | 1112 | for( i = 0; i < p_ec->i_count; i++ ) |
|---|
| 1113 | 1113 | { |
|---|