[vlc-commits] transcode: fix double free in stream deletion

Awais Chishti git at videolan.org
Wed Mar 27 08:53:12 CET 2019


vlc | branch: master | Awais Chishti <chishtiawais511 at gmail.com> | Wed Mar 20 15:08:23 2019 +0500| [5c2e26bccac2b146bff8880b9db4f5f6ad765b35] | committer: Thomas Guillem

transcode: fix double free in stream deletion

The decoder is already cleaned once in DeleteSoutStreamID() that is always
excecuted after transcode_audio_clean / transcode_video_clean /
transcode_spu_clean.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/stream_out/transcode/audio.c | 9 ---------
 modules/stream_out/transcode/spu.c   | 5 -----
 modules/stream_out/transcode/video.c | 6 ------
 3 files changed, 20 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index dd8dac3908..bf1b5d772d 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -201,15 +201,6 @@ int transcode_audio_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
 
 void transcode_audio_clean( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
 {
-    /* Close decoder */
-    if( id->p_decoder->p_module )
-        module_unneed( id->p_decoder, id->p_decoder->p_module );
-    id->p_decoder->p_module = NULL;
-
-    if( id->p_decoder->p_description )
-        vlc_meta_Delete( id->p_decoder->p_description );
-    id->p_decoder->p_description = NULL;
-
     /* Close encoder */
     transcode_encoder_close( id->encoder );
     transcode_encoder_delete( id->encoder );
diff --git a/modules/stream_out/transcode/spu.c b/modules/stream_out/transcode/spu.c
index b491774241..83426d1d69 100644
--- a/modules/stream_out/transcode/spu.c
+++ b/modules/stream_out/transcode/spu.c
@@ -159,11 +159,6 @@ int transcode_spu_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
 void transcode_spu_clean( sout_stream_t *p_stream, sout_stream_id_sys_t *id)
 {
     VLC_UNUSED(p_stream);
-    /* Close decoder */
-    if( id->p_decoder->p_module )
-        module_unneed( id->p_decoder, id->p_decoder->p_module );
-    if( id->p_decoder->p_description )
-        vlc_meta_Delete( id->p_decoder->p_description );
 
     /* Close encoder */
     if( id->encoder )
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 24556e1b2d..ef64cf7539 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -310,12 +310,6 @@ void transcode_video_clean( sout_stream_t *p_stream,
 {
     VLC_UNUSED(p_stream);
 
-    /* Close decoder */
-    if( id->p_decoder->p_module )
-        module_unneed( id->p_decoder, id->p_decoder->p_module );
-    if( id->p_decoder->p_description )
-        vlc_meta_Delete( id->p_decoder->p_description );
-
     /* Close encoder */
     transcode_encoder_close( id->encoder );
     transcode_encoder_delete( id->encoder );



More information about the vlc-commits mailing list