/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->b_packetizer = false;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
switch( p_dec->fmt_in.i_codec )
{
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_sys->p_logtos16 = NULL;
/* Allocate the memory needed to store the encoder's structure */
if( ( p_enc->p_sys = p_sys =
(encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->pf_encode_audio = EncoderEncode;
p_enc->fmt_in.i_codec = p_enc->fmt_out.i_codec;
/* Allocate the memory needed to store the decoder's structure */
p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) );
if( p_sys == NULL )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
/* init of p_sys */
memset( p_sys, 0, sizeof( *p_sys ) );
/* We allocate a buffer big enough for normal case */
psz = malloc( i_size );
+ if( !psz )
+ return NULL;
*psz = '\0';
if( b_html )
Eia608Strlcat( psz, "<text>", i_size );
/* Allocate the memory needed to store the decoder's structure */
p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t));
if( !p_sys )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Init */
memset( p_sys, 0, sizeof(*p_sys) );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
memset( &p_sys->context, 0, sizeof( cinepak_context_t ) );
var_Create( p_dec, "grayscale", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
{
p_context->p_pix[i] = malloc( p_context->i_stride[i] *
p_context->i_lines[i] );
+ if( p_context->p_pix[i] == NULL )
+ return -1;
/* Set it to all black */
memset( p_context->p_pix[i], ( i == 0 ) ? 0 : 128 ,
p_context->i_stride[i] * p_context->i_lines[i] );
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
if( !p_sys )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
memset( &p_dec->p_sys->fmt_cached, 0, sizeof( p_dec->p_sys->fmt_cached ) );
p_sys->pf_push_packet = p_streamext->push_packet;
p_spu->p_sys = malloc( sizeof( subpicture_sys_t ));
if( !p_spu->p_sys )
{
- msg_Err( p_dec, "out of memory" );
p_dec->pf_spu_buffer_del( p_dec, p_spu );
block_Release( *pp_block );
*pp_block = NULL;
p_spu->p_sys->p_subs_data = malloc( p_block->i_buffer );
if( !p_spu->p_sys->p_subs_data )
{
- msg_Err( p_dec, "out of memory" );
free( p_spu->p_sys );
p_dec->pf_spu_buffer_del( p_dec, p_spu );
block_Release( *pp_block );
}
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
p_sys->b_packetizer = false;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_sys->p_dirac = p_dirac;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
memset( p_sys, 0, sizeof(encoder_sys_t) );
p_enc->p_sys = p_sys;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->b_packetizer = false;
p_dec->pf_decode_sub = Decode;
p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) );
if( !p_sys )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_sys->i_pts = (mtime_t) 0;
#ifdef DEBUG_DVBSUB
msg_Dbg( p_dec, "new clut: %i", i_id );
#endif
- p_clut = malloc( sizeof(dvbsub_clut_t) );
+ p_clut = malloc( sizeof( dvbsub_clut_t ) );
+ if( !p_clut )
+ return;
p_clut->p_next = p_sys->p_cluts;
p_sys->p_cluts = p_clut;
}
#endif
/* Allocate a new page */
p_sys->p_page = malloc( sizeof(dvbsub_page_t) );
+ if( !p_sys->p_page )
+ return;
}
p_sys->p_page->i_version = i_version;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Open a faad context */
if( ( p_sys->hfaad = faacDecOpen() ) == NULL )
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
/* Misc init */
aout_DateSet( &p_sys->end_date, 0 );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
p_enc->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
/* init of p_sys */
#ifdef ENABLE_PACKETIZER
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->b_packetizer = false;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->i_pts = 0;
p_sys->b_inited = false;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->b_packetizer = false;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
/* Decode picture */
p_row_pointers = malloc( sizeof(png_bytep) * i_height );
+ if( !p_row_pointers )
+ goto error;
for( i = 0; i < (int)i_height; i++ )
p_row_pointers[i] = p_pic->p->p_pixels + p_pic->p->i_pitch * i;
p_sys->i_buffer = 0;
p_sys->i_buffer_size = 100*1000;
p_sys->p_buffer = malloc( p_sys->i_buffer_size );
+ if( !p_sys->p_buffer )
+ goto exit_error;
p_sys->i_out = 0;
p_sys->i_out_frames = 0;
static int OpenVideo( decoder_t *p_dec )
{
decoder_sys_t *p_sys = malloc( sizeof( decoder_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
#ifndef WIN32
vlc_mutex_t *lock;
/* codec data FIXME use codec not SVQ3 */
msg_Dbg( p_dec, "vide = %d", i_vide );
id = malloc( sizeof( ImageDescription ) + ( i_vide - 70 ) );
+ if( !id )
+ goto exit_error;
id->idSize = sizeof( ImageDescription ) + ( i_vide - 70 );
id->cType = FCC( fcc[0], fcc[1], fcc[2], fcc[3] );
id->version = GetWBE ( p_vide + 0 );
memcpy( *p_sys->framedescHandle, id, id->idSize );
p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );
+ if( !p_sys->plane )
+ goto exit_error;
i_result = p_sys->QTNewGWorldFromPtr( &p_sys->OutBufferGWorld,
/*pixel format of new GWorld==YUY2 */
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_dec->p_sys->b_packetizer = false;
p_sys->i_pts = 0;
}
p_tmp = malloc( pic.p[0].i_pitch );
+ if( !p_tmp )
+ return p_block;
p_pixels = p_block->p_buffer;
for( i = 0; i < pic.i_planes; i++ )
{
}
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
memset( p_sys, 0, sizeof(decoder_sys_t) );
/* Flavor for SIPR codecs */
p_dec->pf_decode_audio = Decode;
p_sys->p_out = malloc( 4096 * 10 );
+ if( !p_sys->p_out )
+ {
+ free( p_sys );
+ return VLC_ENOMEM;
+ }
p_sys->i_out = 0;
return VLC_SUCCESS;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_sys->psz_sdl_type = p_supported_fmt[i].psz_sdl_type;
/* Set output properties - this is a decoy and isn't used anywhere */
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_dec->p_sys->bits.buf_size = 0;
p_dec->p_sys->b_packetizer = false;
p_dec->p_sys->rtp_rate = p_dec->fmt_in.audio.i_rate;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Set output properties */
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->pf_decode_sub = Decode;
p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) );
if( p_sys == NULL )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
memset( p_sys, 0, sizeof(decoder_sys_t) );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_dec->p_sys->b_packetizer = false;
p_sys->i_pts = 0;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_video = Encode;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
aout_DateSet( &p_sys->end_date, 0 );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
p_enc->pf_encode_video = Encode;
p_enc->pf_encode_audio = NULL;
p_enc->p_sys = p_sys = malloc( sizeof( encoder_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
p_sys->i_interpolated_dts = 0;
p_sys->psz_stat_name = NULL;
p_pic = ( picture_t * ) malloc( sizeof( picture_t ) );
if( !p_pic )
- {
- msg_Err( p_dec, "out of memory" );
goto error;
- }
memset( &fmt_in, 0, sizeof( video_format_t ) );
memset( p_pic, 0, sizeof( picture_t ) );