Commit 7aeaeaa4 authored by François Cartegnie's avatar François Cartegnie 🤞

codec: lpcm: fix leak on error

parent 681866b7
......@@ -458,11 +458,12 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
/* */
block_t *p_aout_buffer;
if( decoder_UpdateAudioFormat( p_dec ) )
return NULL;
p_aout_buffer = decoder_NewAudioBuffer( p_dec, i_frame_length );
if( !p_aout_buffer )
if( decoder_UpdateAudioFormat( p_dec ) != VLC_SUCCESS ||
!(p_aout_buffer = decoder_NewAudioBuffer( p_dec, i_frame_length )) )
{
block_Release( p_block );
return NULL;
}
p_aout_buffer->i_pts = date_Get( &p_sys->end_date );
p_aout_buffer->i_length =
......
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