Commit f9043113 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg: fixed a couple of corner cases during initialization.

parent a4f05a55
...@@ -126,6 +126,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -126,6 +126,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
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 );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
......
...@@ -263,7 +263,7 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -263,7 +263,7 @@ static int OpenDecoder( vlc_object_t *p_this )
i_result = VLC_EGENERIC; i_result = VLC_EGENERIC;
} }
p_dec->p_sys->i_cat = i_cat; if( i_result == VLC_SUCCESS ) p_dec->p_sys->i_cat = i_cat;
return i_result; return i_result;
} }
......
...@@ -405,6 +405,7 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -405,6 +405,7 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
{ {
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
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 );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
......
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