Changeset b674dab81ccd2a089896b26a2afc258118e6a990
- Timestamp:
- 06/22/08 21:41:15
(3 months ago)
- Author:
- Rémi Duraffort <ivoire@videolan.org>
- git-committer:
- Rémi Duraffort <ivoire@videolan.org> 1214163675 +0200
- git-parent:
[7d1d56fec646569bd14262f6b9dde31becbe2137]
- git-author:
- Rémi Duraffort <ivoire@videolan.org> 1214056999 +0200
- Message:
Remove unneeded msg_Error about memory failure.
Fix a double malloc.
Fix potential segfault.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd974dcd |
rb674dab |
|
| 635 | 635 | if( p_cdda == NULL ) |
|---|
| 636 | 636 | { |
|---|
| 637 | | msg_Err( p_access, "out of memory" ); |
|---|
| 638 | 637 | free( psz_source ); |
|---|
| 639 | 638 | return VLC_ENOMEM; |
|---|
| r3561b9b |
rb674dab |
|
| 228 | 228 | p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); |
|---|
| 229 | 229 | if( !p_sys ) |
|---|
| 230 | | { |
|---|
| 231 | | msg_Err( p_demux, "not enough memory available" ); |
|---|
| 232 | 230 | return VLC_ENOMEM; |
|---|
| 233 | | } |
|---|
| 234 | 231 | memset( p_sys, 0, sizeof( demux_sys_t ) ); |
|---|
| 235 | 232 | memset( &fmt, 0, sizeof( es_format_t ) ); |
|---|
| r2c16687 |
rb674dab |
|
| 340 | 340 | { |
|---|
| 341 | 341 | msg_Dbg(p_access, "libproxy suggest to use '%s'", proxies[0]); |
|---|
| 342 | | if(strcmp(proxies[0],"direct://") != 0) |
|---|
| | 342 | if(strcmp(proxies[0],"direct://") != 0) |
|---|
| 343 | 343 | { |
|---|
| 344 | 344 | p_sys->b_proxy = true; |
|---|
| r3561b9b |
rb674dab |
|
| 89 | 89 | vlc_object_create( p_access, sizeof( rtmp_control_thread_t ) ); |
|---|
| 90 | 90 | if( !p_sys->p_thread ) |
|---|
| 91 | | { |
|---|
| 92 | | msg_Err( p_access, "out of memory" ); |
|---|
| 93 | 91 | return VLC_ENOMEM; |
|---|
| 94 | | } |
|---|
| 95 | 92 | vlc_object_attach( p_sys->p_thread, p_access ); |
|---|
| 96 | 93 | |
|---|
| r3587742 |
rb674dab |
|
| 1663 | 1663 | p_sys->p_buffers = calloc( 1, sizeof( *p_sys->p_buffers ) ); |
|---|
| 1664 | 1664 | if( !p_sys->p_buffers ) |
|---|
| 1665 | | { |
|---|
| 1666 | | msg_Err( p_demux, "Out of memory" ); |
|---|
| 1667 | 1665 | goto open_failed; |
|---|
| 1668 | | } |
|---|
| 1669 | 1666 | |
|---|
| 1670 | 1667 | p_sys->p_buffers[0].length = i_buffer_size; |
|---|
| 1671 | 1668 | p_sys->p_buffers[0].start = malloc( i_buffer_size ); |
|---|
| 1672 | 1669 | if( !p_sys->p_buffers[0].start ) |
|---|
| 1673 | | { |
|---|
| 1674 | | msg_Err( p_demux, "Out of memory" ); |
|---|
| 1675 | 1670 | goto open_failed; |
|---|
| 1676 | | } |
|---|
| 1677 | 1671 | |
|---|
| 1678 | 1672 | return VLC_SUCCESS; |
|---|
| r3561b9b |
rb674dab |
|
| 97 | 97 | p_vcddev = (vcddev_t *)malloc( sizeof(vcddev_t) ); |
|---|
| 98 | 98 | if( p_vcddev == NULL ) |
|---|
| 99 | | { |
|---|
| 100 | | msg_Err( p_this, "out of memory" ); |
|---|
| 101 | 99 | return NULL; |
|---|
| 102 | | } |
|---|
| 103 | 100 | p_vcddev->i_vcdimage_handle = -1; |
|---|
| 104 | 101 | p_vcddev->psz_dev = NULL; |
|---|
| … | … | |
| 212 | 209 | *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) ); |
|---|
| 213 | 210 | if( *pp_sectors == NULL ) |
|---|
| 214 | | { |
|---|
| 215 | | msg_Err( p_this, "out of memory" ); |
|---|
| 216 | 211 | return 0; |
|---|
| 217 | | } |
|---|
| 218 | 212 | memcpy( *pp_sectors, p_vcddev->p_sectors, |
|---|
| 219 | 213 | (i_tracks + 1) * sizeof(int) ); |
|---|
| … | … | |
| 252 | 246 | if( *pp_sectors == NULL ) |
|---|
| 253 | 247 | { |
|---|
| 254 | | msg_Err( p_this, "out of memory" ); |
|---|
| 255 | 248 | darwin_freeTOC( pTOC ); |
|---|
| 256 | 249 | return 0; |
|---|
| … | … | |
| 361 | 354 | free( *pp_sectors ); |
|---|
| 362 | 355 | free( p_fulltoc ); |
|---|
| 363 | | msg_Err( p_this, "out of memory" ); |
|---|
| 364 | 356 | CloseHandle( hEvent ); |
|---|
| 365 | 357 | return 0; |
|---|
| … | … | |
| 424 | 416 | *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) ); |
|---|
| 425 | 417 | if( *pp_sectors == NULL ) |
|---|
| 426 | | { |
|---|
| 427 | | msg_Err( p_this, "out of memory" ); |
|---|
| 428 | 418 | return 0; |
|---|
| 429 | | } |
|---|
| 430 | 419 | |
|---|
| 431 | 420 | for( i = 0 ; i <= i_tracks ; i++ ) |
|---|
| … | … | |
| 460 | 449 | *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) ); |
|---|
| 461 | 450 | if( *pp_sectors == NULL ) |
|---|
| 462 | | { |
|---|
| 463 | | msg_Err( p_this, "out of memory" ); |
|---|
| 464 | 451 | return 0; |
|---|
| 465 | | } |
|---|
| 466 | 452 | |
|---|
| 467 | 453 | toc_entries.address_format = CD_LBA_FORMAT; |
|---|
| … | … | |
| 473 | 459 | if( toc_entries.data == NULL ) |
|---|
| 474 | 460 | { |
|---|
| 475 | | msg_Err( p_this, "out of memory" ); |
|---|
| 476 | 461 | free( *pp_sectors ); |
|---|
| 477 | 462 | return 0; |
|---|
| … | … | |
| 519 | 504 | *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) ); |
|---|
| 520 | 505 | if( *pp_sectors == NULL ) |
|---|
| 521 | | { |
|---|
| 522 | | msg_Err( p_this, "out of memory" ); |
|---|
| 523 | 506 | return 0; |
|---|
| 524 | | } |
|---|
| 525 | 507 | |
|---|
| 526 | 508 | /* Fill the p_sectors structure with the track/sector matches */ |
|---|
| r3561b9b |
rb674dab |
|
| 107 | 107 | p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) ); |
|---|
| 108 | 108 | if ( p_filter->p_sys == NULL ) |
|---|
| 109 | | { |
|---|
| 110 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 111 | | return VLC_EGENERIC; |
|---|
| 112 | | } |
|---|
| | 109 | return VLC_ENOMEM; |
|---|
| 113 | 110 | p_filter->p_sys->i_left = -1; |
|---|
| 114 | 111 | p_filter->p_sys->i_center = -1; |
|---|
| r3561b9b |
rb674dab |
|
| 246 | 246 | * p_data->i_nb_atomic_operations ); |
|---|
| 247 | 247 | if( p_data->p_atomic_operations == NULL ) |
|---|
| 248 | | { |
|---|
| 249 | | msg_Err( p_this, "out of memory" ); |
|---|
| 250 | 248 | return -1; |
|---|
| 251 | | } |
|---|
| 252 | 249 | |
|---|
| 253 | 250 | /* For each virtual speaker, computes elementary wave propagation time |
|---|
| … | … | |
| 347 | 344 | p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size ); |
|---|
| 348 | 345 | if( p_data->p_atomic_operations == NULL ) |
|---|
| 349 | | { |
|---|
| 350 | | msg_Err( p_this, "out of memory" ); |
|---|
| 351 | 346 | return -1; |
|---|
| 352 | | } |
|---|
| 353 | 347 | memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size ); |
|---|
| 354 | 348 | |
|---|
| … | … | |
| 412 | 406 | p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) ); |
|---|
| 413 | 407 | if( p_filter->p_sys == NULL ) |
|---|
| 414 | | { |
|---|
| 415 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 416 | | return VLC_EGENERIC; |
|---|
| 417 | | } |
|---|
| | 408 | return VLC_ENOMEM; |
|---|
| 418 | 409 | p_filter->p_sys->i_overflow_buffer_size = 0; |
|---|
| 419 | 410 | p_filter->p_sys->p_overflow_buffer = NULL; |
|---|
| … | … | |
| 627 | 618 | p_filter->p_sys = malloc( sizeof(struct filter_sys_t) ); |
|---|
| 628 | 619 | if( p_filter->p_sys == NULL ) |
|---|
| 629 | | { |
|---|
| 630 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 631 | | return VLC_EGENERIC; |
|---|
| 632 | | } |
|---|
| | 620 | return VLC_ENOMEM; |
|---|
| 633 | 621 | p_filter->p_sys->i_overflow_buffer_size = 0; |
|---|
| 634 | 622 | p_filter->p_sys->p_overflow_buffer = NULL; |
|---|
| r3561b9b |
rb674dab |
|
| 248 | 248 | * p_data->i_nb_atomic_operations ); |
|---|
| 249 | 249 | if( p_data->p_atomic_operations == NULL ) |
|---|
| 250 | | { |
|---|
| 251 | | msg_Err( p_this, "out of memory" ); |
|---|
| 252 | 250 | return -1; |
|---|
| 253 | | } |
|---|
| 254 | 251 | |
|---|
| 255 | 252 | /* For each virtual speaker, computes elementary wave propagation time |
|---|
| … | … | |
| 349 | 346 | p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size ); |
|---|
| 350 | 347 | if( p_data->p_atomic_operations == NULL ) |
|---|
| 351 | | { |
|---|
| 352 | | msg_Err( p_this, "out of memory" ); |
|---|
| 353 | 348 | return -1; |
|---|
| 354 | | } |
|---|
| 355 | 349 | memset( p_data->p_overflow_buffer, 0, p_data->i_overflow_buffer_size ); |
|---|
| 356 | 350 | |
|---|
| … | … | |
| 394 | 388 | p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) ); |
|---|
| 395 | 389 | if( p_sys == NULL ) |
|---|
| 396 | | { |
|---|
| 397 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 398 | 390 | return VLC_EGENERIC; |
|---|
| 399 | | } |
|---|
| 400 | 391 | |
|---|
| 401 | 392 | var_Create( p_this, MONO_CFG "downmix", |
|---|
| r55f1d32 |
rb674dab |
|
| 150 | 150 | p_filter->p_sys = (struct aout_filter_sys_t *)p_sys; |
|---|
| 151 | 151 | if( p_sys == NULL ) |
|---|
| 152 | | { |
|---|
| 153 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 154 | 152 | return -1; |
|---|
| 155 | | } |
|---|
| 156 | 153 | |
|---|
| 157 | 154 | i_ret = Open( VLC_OBJECT(p_filter), p_sys, |
|---|
| … | … | |
| 445 | 442 | p_filter->p_sys = p_sys = malloc( sizeof(filter_sys_t) ); |
|---|
| 446 | 443 | if( p_sys == NULL ) |
|---|
| 447 | | { |
|---|
| 448 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 449 | | return VLC_EGENERIC; |
|---|
| 450 | | } |
|---|
| | 444 | return VLC_ENOMEM; |
|---|
| 451 | 445 | |
|---|
| 452 | 446 | i_ret = Open( VLC_OBJECT(p_filter), p_sys, |
|---|
| r55f1d32 |
rb674dab |
|
| 129 | 129 | p_filter->p_sys = (struct aout_filter_sys_t *)p_sys; |
|---|
| 130 | 130 | if( p_sys == NULL ) |
|---|
| 131 | | { |
|---|
| 132 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 133 | 131 | return -1; |
|---|
| 134 | | } |
|---|
| 135 | 132 | |
|---|
| 136 | 133 | i_ret = Open( VLC_OBJECT(p_filter), p_sys, |
|---|
| … | … | |
| 403 | 400 | p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) ); |
|---|
| 404 | 401 | if( p_sys == NULL ) |
|---|
| 405 | | { |
|---|
| 406 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 407 | | return VLC_EGENERIC; |
|---|
| 408 | | } |
|---|
| 409 | | |
|---|
| 410 | | /* Allocate the memory needed to store the module's structure */ |
|---|
| 411 | | p_filter->p_sys = p_sys = malloc( sizeof(filter_sys_t) ); |
|---|
| 412 | | if( p_sys == NULL ) |
|---|
| 413 | | { |
|---|
| 414 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 415 | | return VLC_EGENERIC; |
|---|
| 416 | | } |
|---|
| | 402 | return VLC_ENOMEM; |
|---|
| 417 | 403 | |
|---|
| 418 | 404 | i_ret = Open( VLC_OBJECT(p_filter), p_sys, |
|---|
| r3561b9b |
rb674dab |
|
| 92 | 92 | p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) ); |
|---|
| 93 | 93 | if( p_filter->p_sys == NULL ) |
|---|
| 94 | | { |
|---|
| 95 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 96 | 94 | return VLC_ENOMEM; |
|---|
| 97 | | } |
|---|
| 98 | 95 | memset( p_filter->p_sys, 0, sizeof(struct aout_filter_sys_t) ); |
|---|
| 99 | 96 | p_filter->p_sys->p_buf = 0; |
|---|
| r55f1d32 |
rb674dab |
|
| 105 | 105 | p_filter->p_sys = (struct aout_filter_sys_t *)p_sys; |
|---|
| 106 | 106 | if( p_sys == NULL ) |
|---|
| 107 | | { |
|---|
| 108 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 109 | 107 | return -1; |
|---|
| 110 | | } |
|---|
| 111 | 108 | |
|---|
| 112 | 109 | /* Initialize libmad */ |
|---|
| … | … | |
| 317 | 314 | p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) ); |
|---|
| 318 | 315 | if( p_sys == NULL ) |
|---|
| 319 | | { |
|---|
| 320 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 321 | 316 | return -1; |
|---|
| 322 | | } |
|---|
| 323 | 317 | p_sys->i_reject_count = 0; |
|---|
| 324 | 318 | |
|---|
| r3561b9b |
rb674dab |
|
| 120 | 120 | p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) ); |
|---|
| 121 | 121 | if( p_filter->p_sys == NULL ) |
|---|
| 122 | | { |
|---|
| 123 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 124 | 122 | return VLC_ENOMEM; |
|---|
| 125 | | } |
|---|
| 126 | 123 | |
|---|
| 127 | 124 | /* Calculate worst case for the length of the filter wing */ |
|---|
| … | … | |
| 136 | 133 | p_filter->p_sys->p_buf = malloc( p_filter->p_sys->i_buf_size ); |
|---|
| 137 | 134 | if( p_filter->p_sys->p_buf == NULL ) |
|---|
| 138 | | { |
|---|
| 139 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 140 | 135 | return VLC_ENOMEM; |
|---|
| 141 | | } |
|---|
| 142 | 136 | |
|---|
| 143 | 137 | p_filter->p_sys->i_old_wing = 0; |
|---|
| r3561b9b |
rb674dab |
|
| 100 | 100 | p_filter->p_sys = (struct aout_filter_sys_t *)p_sys; |
|---|
| 101 | 101 | if( p_sys == NULL ) |
|---|
| 102 | | { |
|---|
| 103 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 104 | 102 | return VLC_ENOMEM; |
|---|
| 105 | | } |
|---|
| 106 | 103 | p_sys->p_prev_sample = malloc( |
|---|
| 107 | 104 | p_filter->input.i_channels * sizeof(int32_t) ); |
|---|
| 108 | 105 | if( p_sys->p_prev_sample == NULL ) |
|---|
| 109 | | { |
|---|
| 110 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 111 | 106 | return VLC_ENOMEM; |
|---|
| 112 | | } |
|---|
| 113 | 107 | aout_DateInit( &p_sys->end_date, p_filter->output.i_rate ); |
|---|
| 114 | 108 | |
|---|
| … | … | |
| 276 | 270 | p_filter->p_sys = p_sys = malloc( sizeof(struct filter_sys_t) ); |
|---|
| 277 | 271 | if( p_sys == NULL ) |
|---|
| 278 | | { |
|---|
| 279 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 280 | 272 | return VLC_ENOMEM; |
|---|
| 281 | | } |
|---|
| 282 | 273 | |
|---|
| 283 | 274 | p_sys->p_prev_sample = malloc( |
|---|
| … | … | |
| 285 | 276 | if( p_sys->p_prev_sample == NULL ) |
|---|
| 286 | 277 | { |
|---|
| 287 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 288 | 278 | free( p_sys ); |
|---|
| 289 | 279 | return VLC_ENOMEM; |
|---|
| r3561b9b |
rb674dab |
|
| 290 | 290 | p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) ); |
|---|
| 291 | 291 | if( !p_sys ) |
|---|
| 292 | | { |
|---|
| 293 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 294 | 292 | return VLC_ENOMEM; |
|---|
| 295 | | } |
|---|
| 296 | 293 | p_sys->p_face = 0; |
|---|
| 297 | 294 | p_sys->p_library = 0; |
|---|
| … | … | |
| 325 | 322 | psz_fontfile = (char *)malloc( PATH_MAX + 1 ); |
|---|
| 326 | 323 | if( !psz_fontfile ) |
|---|
| 327 | | { |
|---|
| 328 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 329 | 324 | goto error; |
|---|
| 330 | | } |
|---|
| 331 | 325 | #ifdef WIN32 |
|---|
| 332 | 326 | GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 ); |
|---|
| … | … | |
| 1129 | 1123 | malloc( ( strlen(psz_string) + 1 ) * sizeof(uint32_t) ); |
|---|
| 1130 | 1124 | if( psz_unicode == NULL ) |
|---|
| 1131 | | { |
|---|
| 1132 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 1133 | 1125 | goto error; |
|---|
| 1134 | | } |
|---|
| 1135 | 1126 | #if defined(WORDS_BIGENDIAN) |
|---|
| 1136 | 1127 | iconv_handle = vlc_iconv_open( "UCS-4BE", "UTF-8" ); |
|---|
| … | … | |
| 1175 | 1166 | p_fribidi_string = malloc( (i_string_length + 1) * sizeof(uint32_t) ); |
|---|
| 1176 | 1167 | if( !p_fribidi_string ) |
|---|
| 1177 | | { |
|---|
| 1178 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 1179 | 1168 | goto error; |
|---|
| 1180 | | } |
|---|
| 1181 | 1169 | |
|---|
| 1182 | 1170 | /* Do bidi conversion line-by-line */ |
|---|
| … | … | |
| 1219 | 1207 | * entire string */ |
|---|
| 1220 | 1208 | if( !(p_line = NewLine( strlen( psz_string ))) ) |
|---|
| 1221 | | { |
|---|
| 1222 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 1223 | 1209 | goto error; |
|---|
| 1224 | | } |
|---|
| 1225 | 1210 | p_lines = p_line; |
|---|
| 1226 | 1211 | i_pen_x = i_pen_y = 0; |
|---|
| … | … | |
| 1243 | 1228 | psz_line_start = psz_unicode; |
|---|
| 1244 | 1229 | if( !(p_next = NewLine( strlen( psz_string ))) ) |
|---|
| 1245 | | { |
|---|
| 1246 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 1247 | 1230 | goto error; |
|---|
| 1248 | | } |
|---|
| 1249 | 1231 | p_line->p_next = p_next; |
|---|
| 1250 | 1232 | p_line->i_width = line.xMax; |
|---|
| … | … | |
| 2286 | 2268 | ! p_levels ) |
|---|
| 2287 | 2269 | { |
|---|
| 2288 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 2289 | 2270 | free( p_levels ); |
|---|
| 2290 | 2271 | free( p_old_positions ); |
|---|
| … | … | |
| 2501 | 2482 | if( !psz_unicode ) |
|---|
| 2502 | 2483 | { |
|---|
| 2503 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 2504 | 2484 | if( p_face ) FT_Done_Face( p_face ); |
|---|
| 2505 | 2485 | free( pp_char_styles ); |
|---|
| … | … | |
| 2520 | 2500 | if( !(p_line = NewLine( i_len - i_prev)) ) |
|---|
| 2521 | 2501 | { |
|---|
| 2522 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 2523 | 2502 | if( p_face ) FT_Done_Face( p_face ); |
|---|
| 2524 | 2503 | free( pp_char_styles ); |
|---|
| r3561b9b |
rb674dab |
|
| 168 | 168 | p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) ); |
|---|
| 169 | 169 | if( p_intf->p_sys == NULL ) |
|---|
| 170 | | { |
|---|
| 171 | | msg_Err( p_intf, "out of memory" ); |
|---|
| 172 | 170 | return -1; |
|---|
| 173 | | } |
|---|
| 174 | 171 | |
|---|
| 175 | 172 | psz_mode = var_CreateGetString( p_intf, "logmode" ); |
|---|
| r3561b9b |
rb674dab |
|
| 143 | 143 | p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) ); |
|---|
| 144 | 144 | if( !p_sys ) |
|---|
| 145 | | { |
|---|
| 146 | | msg_Err( p_filter, "out of memory" ); |
|---|
| 147 | 145 | return VLC_ENOMEM; |
|---|
| 148 | | } |
|---|
| 149 | 146 | p_sys->psz_font_name = strdup( DEFAULT_FONT ); |
|---|
| 150 | 147 | p_sys->i_font_opacity = 255; |
|---|
| r6145aa2 |
rb674dab |
|
| 366 | 366 | |
|---|
| 367 | 367 | if( !p_media ) |
|---|
| 368 | | { |
|---|
| 369 | | msg_Err( p_vod, "not enough memory" ); |
|---|
| 370 | 368 | return NULL; |
|---|
| 371 | | } |
|---|
| 372 | 369 | |
|---|
| 373 | 370 | memset( p_media, 0, sizeof(vod_media_t) ); |
|---|
| r3561b9b |
rb674dab |
|
| 179 | 179 | /* Open and read file */ |
|---|
| 180 | 180 | p_buffer = malloc( i_buffer ); |
|---|
| 181 | | if( p_buffer == NULL ) { |
|---|
| 182 | | msg_Err( p_xml, "out of memory" ); |
|---|
| | 181 | if( p_buffer == NULL ) |
|---|
| 183 | 182 | return NULL; |
|---|
| 184 | | } |
|---|
| 185 | 183 | |
|---|
| 186 | 184 | while( ( i_size = stream_Read( s, &p_buffer[i_pos], 2048 ) ) == 2048 ) |
|---|
| … | … | |
| 191 | 189 | if( !p_new ) |
|---|
| 192 | 190 | { |
|---|
| 193 | | msg_Err( p_xml, "out of memory" ); |
|---|
| 194 | 191 | free( p_buffer ); |
|---|
| 195 | 192 | return NULL; |
|---|
| rf5623de |
rb674dab |
|
| 740 | 740 | id = malloc( sizeof( sout_stream_id_t ) ); |
|---|
| 741 | 741 | if( !id ) |
|---|
| 742 | | { |
|---|
| 743 | | msg_Err( p_stream, "out of memory" ); |
|---|
| 744 | 742 | goto error; |
|---|
| 745 | | } |
|---|
| 746 | 743 | memset( id, 0, sizeof(sout_stream_id_t) ); |
|---|
| 747 | 744 | |
|---|
| … | … | |
| 753 | 750 | id->p_decoder = vlc_object_create( p_stream, VLC_OBJECT_DECODER ); |
|---|
| 754 | 751 | if( !id->p_decoder ) |
|---|
| 755 | | { |
|---|
| 756 | | msg_Err( p_stream, "out of memory" ); |
|---|
| 757 | 752 | goto error; |
|---|
| 758 | | } |
|---|
| 759 | 753 | vlc_object_attach( id->p_decoder, p_stream ); |
|---|
| 760 | 754 | id->p_decoder->p_module = NULL; |
|---|
| … | … | |
| 765 | 759 | id->p_encoder = vlc_object_create( p_stream, VLC_OBJECT_ENCODER ); |
|---|
| 766 | 760 | if( !id->p_encoder ) |
|---|
| 767 | | { |
|---|
| 768 | | msg_Err( p_stream, "out of memory" ); |
|---|
| 769 | 761 | goto error; |
|---|
| 770 | | } |
|---|
| 771 | 762 | vlc_object_attach( id->p_encoder, p_stream ); |
|---|
| 772 | 763 | id->p_encoder->p_module = NULL; |
|---|
| … | … | |
| 932 | 923 | return id; |
|---|
| 933 | 924 | |
|---|
| 934 | | error: |
|---|
| 935 | | if( id->p_decoder ) |
|---|
| 936 | | { |
|---|
| 937 | | vlc_object_detach( id->p_decoder ); |
|---|
| 938 | | vlc_object_release( id->p_decoder ); |
|---|
| 939 | | id->p_decoder = NULL; |
|---|
| 940 | | } |
|---|
| 941 | | |
|---|
| 942 | | if( id->p_encoder ) |
|---|
| 943 | | { |
|---|
| 944 | | vlc_object_detach( id->p_encoder ); |
|---|
| 945 | | es_format_Clean( &id->p_encoder->fmt_out ); |
|---|
| 946 | | vlc_object_release( id->p_encoder ); |
|---|
| 947 | | id->p_encoder = NULL; |
|---|
| 948 | | } |
|---|
| 949 | | |
|---|
| 950 | | free( id ); |
|---|
| | 925 | error: |
|---|
| | 926 | if( id ) |
|---|
| | 927 | { |
|---|
| | 928 | if( id->p_decoder ) |
|---|
| | 929 | { |
|---|
| | 930 | vlc_object_detach( id->p_decoder ); |
|---|
| | 931 | vlc_object_release( id->p_decoder ); |
|---|
| | 932 | id->p_decoder = NULL; |
|---|
| | 933 | } |
|---|
| | 934 | |
|---|
| | 935 | if( id->p_encoder ) |
|---|
| | 936 | { |
|---|
| | 937 | vlc_object_detach( id->p_encoder ); |
|---|
| | 938 | es_format_Clean( &id->p_encoder->fmt_out ); |
|---|
| | 939 | vlc_object_release( id->p_encoder ); |
|---|
| | 940 | id->p_encoder = NULL; |
|---|
| | 941 | } |
|---|
| | 942 | |
|---|
| | 943 | free( id ); |
|---|
| | 944 | } |
|---|
| 951 | 945 | return NULL; |
|---|
| 952 | 946 | } |
|---|