[vlc-commits] transcode: audio: Fix potential user after free

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


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

transcode: audio: Fix potential user after free

(cherry picked from commit 720773f5982888f8e6111edc7d095f77075b5556)
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=cef7dd81d07f8f90dfe8188e2584c416b8c16192
---

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

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 4829ea9c11..dc1a9dc74b 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -354,11 +354,14 @@ end:
     /* Drain encoder */
     if( unlikely( !b_error && in == NULL ) )
     {
-        block_t *p_block;
-        do {
-           p_block = id->p_encoder->pf_encode_audio(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_audio(id->p_encoder, NULL );
+               block_ChainAppend( out, p_block );
+            } while( p_block );
+        }
     }
 
     return b_error ? VLC_EGENERIC : VLC_SUCCESS;



More information about the vlc-commits mailing list