Changeset f5266ccf92db33ce9f6234de82b46b96f089e37d
- Timestamp:
- 05/12/08 18:36:21
(4 months ago)
- Author:
- Rémi Duraffort <ivoire@videolan.org>
- git-committer:
- Rémi Duraffort <ivoire@videolan.org> 1210610181 +0200
- git-parent:
[93a5f233a7ba3b8ad9055fa35dbc2012c1dbfc9f]
- git-author:
- Rémi Duraffort <ivoire@videolan.org> 1210610175 +0200
- Message:
Don't print a message when an memory error occure and check some malloc return values.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r27d483e |
rf5266cc |
|
| 125 | 125 | if( ( p_dec->p_sys = p_sys = |
|---|
| 126 | 126 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 127 | | { |
|---|
| 128 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 129 | | return VLC_EGENERIC; |
|---|
| 130 | | } |
|---|
| | 127 | return VLC_ENOMEM; |
|---|
| 131 | 128 | |
|---|
| 132 | 129 | /* Misc init */ |
|---|
| r27d483e |
rf5266cc |
|
| 168 | 168 | if( ( p_dec->p_sys = p_sys = |
|---|
| 169 | 169 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 170 | | { |
|---|
| 171 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 172 | 170 | return VLC_ENOMEM; |
|---|
| 173 | | } |
|---|
| 174 | 171 | |
|---|
| 175 | 172 | switch( p_dec->fmt_in.i_codec ) |
|---|
| r27d483e |
rf5266cc |
|
| 228 | 228 | if( ( p_dec->p_sys = p_sys = |
|---|
| 229 | 229 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 230 | | { |
|---|
| 231 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 232 | | return VLC_EGENERIC; |
|---|
| 233 | | } |
|---|
| | 230 | return VLC_ENOMEM; |
|---|
| 234 | 231 | |
|---|
| 235 | 232 | p_sys->p_logtos16 = NULL; |
|---|
| … | … | |
| 1425 | 1422 | if( ( p_enc->p_sys = p_sys = |
|---|
| 1426 | 1423 | (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 1427 | | { |
|---|
| 1428 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 1429 | | return VLC_EGENERIC; |
|---|
| 1430 | | } |
|---|
| | 1424 | return VLC_ENOMEM; |
|---|
| 1431 | 1425 | |
|---|
| 1432 | 1426 | p_enc->pf_encode_audio = EncoderEncode; |
|---|
| r27d483e |
rf5266cc |
|
| 200 | 200 | p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) ); |
|---|
| 201 | 201 | if( p_sys == NULL ) |
|---|
| 202 | | { |
|---|
| 203 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 204 | 202 | return VLC_ENOMEM; |
|---|
| 205 | | } |
|---|
| 206 | 203 | |
|---|
| 207 | 204 | /* init of p_sys */ |
|---|
| … | … | |
| 1111 | 1108 | /* We allocate a buffer big enough for normal case */ |
|---|
| 1112 | 1109 | psz = malloc( i_size ); |
|---|
| | 1110 | if( !psz ) |
|---|
| | 1111 | return NULL; |
|---|
| 1113 | 1112 | *psz = '\0'; |
|---|
| 1114 | 1113 | if( b_html ) |
|---|
| r27d483e |
rf5266cc |
|
| 104 | 104 | p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)); |
|---|
| 105 | 105 | if( !p_sys ) |
|---|
| 106 | | { |
|---|
| 107 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 108 | | return VLC_EGENERIC; |
|---|
| 109 | | } |
|---|
| | 106 | return VLC_ENOMEM; |
|---|
| 110 | 107 | |
|---|
| 111 | 108 | /* Init */ |
|---|
| r27d483e |
rf5266cc |
|
| 117 | 117 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 118 | 118 | if( ( p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 119 | | { |
|---|
| 120 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 121 | | return VLC_EGENERIC; |
|---|
| 122 | | } |
|---|
| | 119 | return VLC_ENOMEM; |
|---|
| 123 | 120 | memset( &p_sys->context, 0, sizeof( cinepak_context_t ) ); |
|---|
| 124 | 121 | |
|---|
| … | … | |
| 449 | 446 | p_context->p_pix[i] = malloc( p_context->i_stride[i] * |
|---|
| 450 | 447 | p_context->i_lines[i] ); |
|---|
| | 448 | if( p_context->p_pix[i] == NULL ) |
|---|
| | 449 | return -1; |
|---|
| 451 | 450 | /* Set it to all black */ |
|---|
| 452 | 451 | memset( p_context->p_pix[i], ( i == 0 ) ? 0 : 128 , |
|---|
| r27d483e |
rf5266cc |
|
| 127 | 127 | p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) ); |
|---|
| 128 | 128 | if( !p_sys ) |
|---|
| 129 | | { |
|---|
| 130 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 131 | 129 | return VLC_ENOMEM; |
|---|
| 132 | | } |
|---|
| 133 | 130 | memset( &p_dec->p_sys->fmt_cached, 0, sizeof( p_dec->p_sys->fmt_cached ) ); |
|---|
| 134 | 131 | |
|---|
| … | … | |
| 181 | 178 | if( !p_spu->p_sys ) |
|---|
| 182 | 179 | { |
|---|
| 183 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 184 | 180 | p_dec->pf_spu_buffer_del( p_dec, p_spu ); |
|---|
| 185 | 181 | block_Release( *pp_block ); |
|---|
| … | … | |
| 193 | 189 | if( !p_spu->p_sys->p_subs_data ) |
|---|
| 194 | 190 | { |
|---|
| 195 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 196 | 191 | free( p_spu->p_sys ); |
|---|
| 197 | 192 | p_dec->pf_spu_buffer_del( p_dec, p_spu ); |
|---|
| r27d483e |
rf5266cc |
|
| 118 | 118 | |
|---|
| 119 | 119 | p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) ); |
|---|
| | 120 | if( !p_sys ) |
|---|
| | 121 | return VLC_ENOMEM; |
|---|
| 120 | 122 | |
|---|
| 121 | 123 | p_sys->b_packetizer = false; |
|---|
| r27d483e |
rf5266cc |
|
| 111 | 111 | if( ( p_dec->p_sys = p_sys = |
|---|
| 112 | 112 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 113 | | { |
|---|
| 114 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 115 | | return VLC_EGENERIC; |
|---|
| 116 | | } |
|---|
| | 113 | return VLC_ENOMEM; |
|---|
| 117 | 114 | |
|---|
| 118 | 115 | p_sys->p_dirac = p_dirac; |
|---|
| … | … | |
| 346 | 343 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 347 | 344 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 348 | | { |
|---|
| 349 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 350 | | return VLC_EGENERIC; |
|---|
| 351 | | } |
|---|
| | 345 | return VLC_ENOMEM; |
|---|
| 352 | 346 | memset( p_sys, 0, sizeof(encoder_sys_t) ); |
|---|
| 353 | 347 | p_enc->p_sys = p_sys; |
|---|
| r27d483e |
rf5266cc |
|
| 125 | 125 | if( ( p_dec->p_sys = p_sys = |
|---|
| 126 | 126 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 127 | | { |
|---|
| 128 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 129 | | return VLC_EGENERIC; |
|---|
| 130 | | } |
|---|
| | 127 | return VLC_ENOMEM; |
|---|
| 131 | 128 | |
|---|
| 132 | 129 | /* Misc init */ |
|---|
| r27d483e |
rf5266cc |
|
| 304 | 304 | p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) ); |
|---|
| 305 | 305 | if( !p_sys ) |
|---|
| 306 | | { |
|---|
| 307 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 308 | 306 | return VLC_ENOMEM; |
|---|
| 309 | | } |
|---|
| 310 | 307 | memset( p_sys, 0, sizeof(decoder_sys_t) ); |
|---|
| 311 | 308 | |
|---|
| … | … | |
| 635 | 632 | msg_Dbg( p_dec, "new clut: %i", i_id ); |
|---|
| 636 | 633 | #endif |
|---|
| 637 | | p_clut = malloc( sizeof(dvbsub_clut_t) ); |
|---|
| | 634 | p_clut = malloc( sizeof( dvbsub_clut_t ) ); |
|---|
| | 635 | if( !p_clut ) |
|---|
| | 636 | return; |
|---|
| 638 | 637 | p_clut->p_next = p_sys->p_cluts; |
|---|
| 639 | 638 | p_sys->p_cluts = p_clut; |
|---|
| … | … | |
| 773 | 772 | /* Allocate a new page */ |
|---|
| 774 | 773 | p_sys->p_page = malloc( sizeof(dvbsub_page_t) ); |
|---|
| | 774 | if( !p_sys->p_page ) |
|---|
| | 775 | return; |
|---|
| 775 | 776 | } |
|---|
| 776 | 777 | |
|---|
| r27d483e |
rf5266cc |
|
| 128 | 128 | if( ( p_dec->p_sys = p_sys = |
|---|
| 129 | 129 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 130 | | { |
|---|
| 131 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 132 | | return VLC_EGENERIC; |
|---|
| 133 | | } |
|---|
| | 130 | return VLC_ENOMEM; |
|---|
| 134 | 131 | |
|---|
| 135 | 132 | /* Open a faad context */ |
|---|
| r27d483e |
rf5266cc |
|
| 215 | 215 | if( ( p_dec->p_sys = p_sys = |
|---|
| 216 | 216 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 217 | | { |
|---|
| 218 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 219 | 217 | return VLC_ENOMEM; |
|---|
| 220 | | } |
|---|
| 221 | 218 | |
|---|
| 222 | 219 | /* Misc init */ |
|---|
| … | … | |
| 1231 | 1228 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 1232 | 1229 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 1233 | | { |
|---|
| 1234 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 1235 | | return VLC_EGENERIC; |
|---|
| 1236 | | } |
|---|
| | 1230 | return VLC_ENOMEM; |
|---|
| 1237 | 1231 | p_enc->p_sys = p_sys; |
|---|
| 1238 | 1232 | p_enc->pf_encode_audio = Encode; |
|---|
| rd9752f1 |
rf5266cc |
|
| 160 | 160 | if( ( p_dec->p_sys = p_sys = |
|---|
| 161 | 161 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 162 | | { |
|---|
| 163 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 164 | 162 | return VLC_ENOMEM; |
|---|
| 165 | | } |
|---|
| 166 | 163 | |
|---|
| 167 | 164 | /* init of p_sys */ |
|---|
| r27d483e |
rf5266cc |
|
| 114 | 114 | if( ( p_dec->p_sys = p_sys = |
|---|
| 115 | 115 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 116 | | { |
|---|
| 117 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 118 | | return VLC_EGENERIC; |
|---|
| 119 | | } |
|---|
| | 116 | return VLC_ENOMEM; |
|---|
| 120 | 117 | |
|---|
| 121 | 118 | /* Misc init */ |
|---|
| r27d483e |
rf5266cc |
|
| 98 | 98 | if( ( p_dec->p_sys = p_sys = |
|---|
| 99 | 99 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 100 | | { |
|---|
| 101 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 102 | | return VLC_EGENERIC; |
|---|
| 103 | | } |
|---|
| | 100 | return VLC_ENOMEM; |
|---|
| 104 | 101 | /* Misc init */ |
|---|
| 105 | 102 | p_sys->i_pts = 0; |
|---|
| r27d483e |
rf5266cc |
|
| 153 | 153 | if( ( p_dec->p_sys = p_sys = |
|---|
| 154 | 154 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 155 | | { |
|---|
| 156 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 157 | | return VLC_EGENERIC; |
|---|
| 158 | | } |
|---|
| | 155 | return VLC_ENOMEM; |
|---|
| 159 | 156 | |
|---|
| 160 | 157 | /* Misc init */ |
|---|
| r27d483e |
rf5266cc |
|
| 80 | 80 | if( ( p_dec->p_sys = p_sys = |
|---|
| 81 | 81 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 82 | | { |
|---|
| 83 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 84 | | return VLC_EGENERIC; |
|---|
| 85 | | } |
|---|
| | 82 | return VLC_ENOMEM; |
|---|
| 86 | 83 | |
|---|
| 87 | 84 | /* Set output properties */ |
|---|
| … | … | |
| 218 | 215 | /* Decode picture */ |
|---|
| 219 | 216 | p_row_pointers = malloc( sizeof(png_bytep) * i_height ); |
|---|
| | 217 | if( !p_row_pointers ) |
|---|
| | 218 | goto error; |
|---|
| 220 | 219 | for( i = 0; i < (int)i_height; i++ ) |
|---|
| 221 | 220 | p_row_pointers[i] = p_pic->p->p_pixels + p_pic->p->i_pitch * i; |
|---|
| r27d483e |
rf5266cc |
|
| 463 | 463 | p_sys->i_buffer_size = 100*1000; |
|---|
| 464 | 464 | p_sys->p_buffer = malloc( p_sys->i_buffer_size ); |
|---|
| | 465 | if( !p_sys->p_buffer ) |
|---|
| | 466 | goto exit_error; |
|---|
| 465 | 467 | |
|---|
| 466 | 468 | p_sys->i_out = 0; |
|---|
| … | … | |
| 622 | 624 | { |
|---|
| 623 | 625 | decoder_sys_t *p_sys = malloc( sizeof( decoder_sys_t ) ); |
|---|
| | 626 | if( !p_sys ) |
|---|
| | 627 | return VLC_ENOMEM; |
|---|
| 624 | 628 | |
|---|
| 625 | 629 | #ifndef WIN32 |
|---|
| … | … | |
| 717 | 721 | msg_Dbg( p_dec, "vide = %d", i_vide ); |
|---|
| 718 | 722 | id = malloc( sizeof( ImageDescription ) + ( i_vide - 70 ) ); |
|---|
| | 723 | if( !id ) |
|---|
| | 724 | goto exit_error; |
|---|
| 719 | 725 | id->idSize = sizeof( ImageDescription ) + ( i_vide - 70 ); |
|---|
| 720 | 726 | id->cType = FCC( fcc[0], fcc[1], fcc[2], fcc[3] ); |
|---|
| … | … | |
| 753 | 759 | |
|---|
| 754 | 760 | p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 ); |
|---|
| | 761 | if( !p_sys->plane ) |
|---|
| | 762 | goto exit_error; |
|---|
| 755 | 763 | |
|---|
| 756 | 764 | i_result = p_sys->QTNewGWorldFromPtr( &p_sys->OutBufferGWorld, |
|---|
| r27d483e |
rf5266cc |
|
| 133 | 133 | if( ( p_dec->p_sys = p_sys = |
|---|
| 134 | 134 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 135 | | { |
|---|
| 136 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 137 | | return VLC_EGENERIC; |
|---|
| 138 | | } |
|---|
| | 135 | return VLC_ENOMEM; |
|---|
| 139 | 136 | /* Misc init */ |
|---|
| 140 | 137 | p_dec->p_sys->b_packetizer = false; |
|---|
| … | … | |
| 339 | 336 | |
|---|
| 340 | 337 | p_tmp = malloc( pic.p[0].i_pitch ); |
|---|
| | 338 | if( !p_tmp ) |
|---|
| | 339 | return p_block; |
|---|
| 341 | 340 | p_pixels = p_block->p_buffer; |
|---|
| 342 | 341 | for( i = 0; i < pic.i_planes; i++ ) |
|---|
| r27d483e |
rf5266cc |
|
| 202 | 202 | |
|---|
| 203 | 203 | p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) ); |
|---|
| | 204 | if( !p_sys ) |
|---|
| | 205 | return VLC_ENOMEM; |
|---|
| 204 | 206 | memset( p_sys, 0, sizeof(decoder_sys_t) ); |
|---|
| 205 | 207 | |
|---|
| … | … | |
| 237 | 239 | |
|---|
| 238 | 240 | p_sys->p_out = malloc( 4096 * 10 ); |
|---|
| | 241 | if( !p_sys->p_out ) |
|---|
| | 242 | { |
|---|
| | 243 | free( p_sys ); |
|---|
| | 244 | return VLC_ENOMEM; |
|---|
| | 245 | } |
|---|
| 239 | 246 | p_sys->i_out = 0; |
|---|
| 240 | 247 | |
|---|
| r27d483e |
rf5266cc |
|
| 109 | 109 | if( ( p_dec->p_sys = p_sys = |
|---|
| 110 | 110 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 111 | | { |
|---|
| 112 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 113 | | return VLC_EGENERIC; |
|---|
| 114 | | } |
|---|
| | 111 | return VLC_ENOMEM; |
|---|
| 115 | 112 | p_sys->psz_sdl_type = p_supported_fmt[i].psz_sdl_type; |
|---|
| 116 | 113 | |
|---|
| r27d483e |
rf5266cc |
|
| 145 | 145 | if( ( p_dec->p_sys = p_sys = |
|---|
| 146 | 146 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 147 | | { |
|---|
| 148 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 149 | | return VLC_EGENERIC; |
|---|
| 150 | | } |
|---|
| | 147 | return VLC_ENOMEM; |
|---|
| 151 | 148 | p_dec->p_sys->bits.buf_size = 0; |
|---|
| 152 | 149 | p_dec->p_sys->b_packetizer = false; |
|---|
| … | … | |
| 866 | 863 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 867 | 864 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 868 | | { |
|---|
| 869 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 870 | | return VLC_EGENERIC; |
|---|
| 871 | | } |
|---|
| | 865 | return VLC_ENOMEM; |
|---|
| 872 | 866 | p_enc->p_sys = p_sys; |
|---|
| 873 | 867 | p_enc->pf_encode_audio = Encode; |
|---|
| r27d483e |
rf5266cc |
|
| 102 | 102 | if( ( p_dec->p_sys = p_sys = |
|---|
| 103 | 103 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 104 | | { |
|---|
| 105 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 106 | | return VLC_EGENERIC; |
|---|
| 107 | | } |
|---|
| | 104 | return VLC_ENOMEM; |
|---|
| 108 | 105 | |
|---|
| 109 | 106 | /* Set output properties */ |
|---|
| r27d483e |
rf5266cc |
|
| 184 | 184 | p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) ); |
|---|
| 185 | 185 | if( p_sys == NULL ) |
|---|
| 186 | | { |
|---|
| 187 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 188 | 186 | return VLC_ENOMEM; |
|---|
| 189 | | } |
|---|
| 190 | 187 | |
|---|
| 191 | 188 | memset( p_sys, 0, sizeof(decoder_sys_t) ); |
|---|
| r27d483e |
rf5266cc |
|
| 142 | 142 | if( ( p_dec->p_sys = p_sys = |
|---|
| 143 | 143 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 144 | | { |
|---|
| 145 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 146 | | return VLC_EGENERIC; |
|---|
| 147 | | } |
|---|
| | 144 | return VLC_ENOMEM; |
|---|
| 148 | 145 | p_dec->p_sys->b_packetizer = false; |
|---|
| 149 | 146 | |
|---|
| … | … | |
| 613 | 610 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 614 | 611 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 615 | | { |
|---|
| 616 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 617 | | return VLC_EGENERIC; |
|---|
| 618 | | } |
|---|
| | 612 | return VLC_ENOMEM; |
|---|
| 619 | 613 | p_enc->p_sys = p_sys; |
|---|
| 620 | 614 | |
|---|
| r27d483e |
rf5266cc |
|
| 161 | 161 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 162 | 162 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 163 | | { |
|---|
| 164 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 165 | | return VLC_EGENERIC; |
|---|
| 166 | | } |
|---|
| | 163 | return VLC_ENOMEM; |
|---|
| 167 | 164 | p_enc->p_sys = p_sys; |
|---|
| 168 | 165 | |
|---|
| r27d483e |
rf5266cc |
|
| 245 | 245 | if( ( p_dec->p_sys = p_sys = |
|---|
| 246 | 246 | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| 247 | | { |
|---|
| 248 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 249 | | return VLC_EGENERIC; |
|---|
| 250 | | } |
|---|
| | 247 | return VLC_ENOMEM; |
|---|
| 251 | 248 | |
|---|
| 252 | 249 | /* Misc init */ |
|---|
| … | … | |
| 875 | 872 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 876 | 873 | if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) |
|---|
| 877 | | { |
|---|
| 878 | | msg_Err( p_enc, "out of memory" ); |
|---|
| 879 | | return VLC_EGENERIC; |
|---|
| 880 | | } |
|---|
| | 874 | return VLC_ENOMEM; |
|---|
| 881 | 875 | p_enc->p_sys = p_sys; |
|---|
| 882 | 876 | |
|---|
| r27d483e |
rf5266cc |
|
| 770 | 770 | p_enc->pf_encode_audio = NULL; |
|---|
| 771 | 771 | p_enc->p_sys = p_sys = malloc( sizeof( encoder_sys_t ) ); |
|---|
| | 772 | if( !p_sys ) |
|---|
| | 773 | return VLC_ENOMEM; |
|---|
| 772 | 774 | p_sys->i_interpolated_dts = 0; |
|---|
| 773 | 775 | p_sys->psz_stat_name = NULL; |
|---|
| r27d483e |
rf5266cc |
|
| 389 | 389 | p_pic = ( picture_t * ) malloc( sizeof( picture_t ) ); |
|---|
| 390 | 390 | if( !p_pic ) |
|---|
| 391 | | { |
|---|
| 392 | | msg_Err( p_dec, "out of memory" ); |
|---|
| 393 | 391 | goto error; |
|---|
| 394 | | } |
|---|
| 395 | 392 | |
|---|
| 396 | 393 | memset( &fmt_in, 0, sizeof( video_format_t ) ); |
|---|