vlc | branch: master | Alexandre Janniaux <[email protected]> | Thu Dec 6 21:36:07 2018 +0100| [f69475d477e6c597a47b8bc55ee61fdf2ec23f02] | committer: Tristan Matthews
avcodec/encoder: fix leak in case of codec opening failure If the required codec is invalid or doesn't match the required codec id, we must release the string obtained from var_GetString. Signed-off-by: Tristan Matthews <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f69475d477e6c597a47b8bc55ee61fdf2ec23f02 --- modules/codec/avcodec/encoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index 201049cf1f..c845723a1d 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -344,12 +344,14 @@ int InitVideoEnc( vlc_object_t *p_this ) if( !p_codec ) { msg_Err( p_this, "Encoder `%s' not found", psz_encoder ); + free( psz_encoder ); return VLC_EGENERIC; } else if( p_codec->id != i_codec_id ) { msg_Err( p_this, "Encoder `%s' can't handle %4.4s", psz_encoder, (char*)&p_enc->fmt_out.i_codec ); + free( psz_encoder ); return VLC_EGENERIC; } } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
