[vlc-commits] transcode: video: Fix potential use after free

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 4 11:27:42 CET 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jan  4 11:18:29 2018 +0100| [a46c4c19eee9c68dd26d1a838d8383e672b0e7b3] | committer: Hugo Beauzée-Luyssen

transcode: video: Fix potential use after free

(cherry picked from commit def1d62dca820b7839082e5674c1400e96a58d90)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/stream_out/transcode/video.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index cb9591933b..0970aca0ea 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -677,13 +677,22 @@ void transcode_video_close( sout_stream_t *p_stream,
 
     /* 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 */
     if( id->p_encoder->p_module )
+    {
         module_unneed( id->p_encoder, id->p_encoder->p_module );
+        id->p_decoder->p_module = NULL;
+    }
 
     /* Close filters */
     if( id->p_f_chain )



More information about the vlc-commits mailing list