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