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

Hugo Beauzée-Luyssen git at videolan.org
Wed Jul 19 16:03:20 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jul 18 17:53:46 2017 +0200| [e7be52b85cb8080a3ec373576240ce6337ebd9ce] | committer: Hugo Beauzée-Luyssen

transcode: Fix potential use after free

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

 modules/stream_out/transcode/video.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 318120c664..6c9ad1265c 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -870,11 +870,14 @@ end:
     {
         if( p_sys->i_threads == 0 )
         {
-            block_t *p_block;
-            do {
-                p_block = id->p_encoder->pf_encode_video(id->p_encoder, NULL );
-                block_ChainAppend( out, p_block );
-            } while( p_block );
+            if( id->p_encoder->p_module )
+            {
+                block_t *p_block;
+                do {
+                    p_block = id->p_encoder->pf_encode_video(id->p_encoder, NULL );
+                    block_ChainAppend( out, p_block );
+                } while( p_block );
+            }
         }
         else
         {



More information about the vlc-commits mailing list