Commit bc0f4098 authored by François Cartegnie's avatar François Cartegnie 🤞

mux: ps: check blocks allocs

parent be2caa1a
......@@ -216,10 +216,13 @@ static void Close( vlc_object_t * p_this )
msg_Info( p_mux, "Close" );
p_end = block_Alloc( 4 );
p_end->p_buffer[0] = 0x00; p_end->p_buffer[1] = 0x00;
p_end->p_buffer[2] = 0x01; p_end->p_buffer[3] = 0xb9;
if( p_end )
{
p_end->p_buffer[0] = 0x00; p_end->p_buffer[1] = 0x00;
p_end->p_buffer[2] = 0x01; p_end->p_buffer[3] = 0xb9;
sout_AccessOutWrite( p_mux->p_access, p_end );
sout_AccessOutWrite( p_mux->p_access, p_end );
}
free( p_sys );
}
......@@ -595,6 +598,8 @@ static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
i_scr = (i_dts - p_sys->i_dts_delay) * 9 / 100;
p_hdr = block_Alloc( 18 );
if( !p_hdr )
return;
p_hdr->i_pts = p_hdr->i_dts = i_dts;
bits_initwrite( &bits, 14, p_hdr->p_buffer );
bits_write( &bits, 32, 0x01ba );
......@@ -669,6 +674,8 @@ static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
( i_nb_private > 0 ? i_nb_private - 1 : 0 );
p_hdr = block_Alloc( 12 + i_nb_stream * 3 );
if( !p_hdr )
return;
p_hdr->i_dts = p_hdr->i_pts = i_dts;
/* The spec specifies that the reported rate_bound must be upper limit */
......@@ -759,6 +766,8 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, mtime_t i_dts )
i_psm_size += i_es_map_size;
p_hdr = block_Alloc( i_psm_size );
if( !p_hdr )
return;
p_hdr->i_dts = p_hdr->i_pts = i_dts;
memset( p_hdr->p_buffer, 0, p_hdr->i_buffer );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment