[vlc-commits] transcode: audio: Fix potential user after free
Hugo Beauzée-Luyssen
git at videolan.org
Thu Jan 4 11:23:45 CET 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jan 4 11:18:15 2018 +0100| [720773f5982888f8e6111edc7d095f77075b5556] | committer: Hugo Beauzée-Luyssen
transcode: audio: Fix potential user after free
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=720773f5982888f8e6111edc7d095f77075b5556
---
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