[vlc-devel] commit: Fix memleak when the codec can't be loaded. ( Rémi Duraffort )

git version control git at videolan.org
Sat Jun 28 23:14:54 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jun 28 23:14:41 2008 +0200| [db4d130ff9597b0b7822a057c5e4303cb85121c7]

Fix memleak when the codec can't be loaded.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=db4d130ff9597b0b7822a057c5e4303cb85121c7
---

 modules/codec/avcodec/video.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index e1335af..6ba12a3 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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;
     }




More information about the vlc-devel mailing list