Commit 8a7520b3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

avcodec: free p_sys->p_ff_pic in some error paths

parent 63ae92da
...@@ -331,6 +331,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -331,6 +331,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->p_buffer_orig = p_sys->p_buffer = malloc( p_sys->i_buffer_orig ); p_sys->p_buffer_orig = p_sys->p_buffer = malloc( p_sys->i_buffer_orig );
if( !p_sys->p_buffer_orig ) if( !p_sys->p_buffer_orig )
{ {
av_free( p_sys->p_ff_pic );
free( p_sys ); free( p_sys );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
...@@ -381,6 +382,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -381,6 +382,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
if( ffmpeg_OpenCodec( p_dec ) < 0 ) if( ffmpeg_OpenCodec( p_dec ) < 0 )
{ {
msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec ); msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
av_free( p_sys->p_ff_pic );
free( p_sys->p_buffer_orig ); 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