Commit db4d130f authored by Rémi Duraffort's avatar Rémi Duraffort

Fix memleak when the codec can't be loaded.

parent 840644c6
......@@ -387,6 +387,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
vlc_mutex_t *lock = var_AcquireMutex( "avcodec" );
if( lock == NULL )
{
free( p_sys->p_buffer_orig );
free( p_sys );
return VLC_ENOMEM;
}
......@@ -395,6 +396,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
{
vlc_mutex_unlock( lock );
msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
free( p_sys->p_buffer_orig );
free( p_sys );
return VLC_EGENERIC;
}
......
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