[vlc-commits] transcode: audio: Fix format copy

Hugo Beauzée-Luyssen git at videolan.org
Mon Aug 21 19:01:41 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Aug 21 18:59:56 2017 +0200| [de8f3ca89a48990d6a0b6531bb540f00f09acc1e] | committer: Hugo Beauzée-Luyssen

transcode: audio: Fix format copy

This was causing a double free during decoder cleanup

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

 modules/stream_out/transcode/audio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 3c26b02d4e..fc59201e16 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -164,7 +164,10 @@ static int transcode_audio_new( sout_stream_t *p_stream,
      */
 
     /* Initialization of decoder structures */
-    id->p_decoder->fmt_out = id->p_decoder->fmt_in;
+
+    /* No need to clean the fmt_out, it was freshly initialized by
+     * es_format_Init in Add() */
+    es_format_Copy( &id->p_decoder->fmt_out, &id->p_decoder->fmt_in );
     id->p_decoder->fmt_out.i_extra = 0;
     id->p_decoder->fmt_out.p_extra = 0;
     id->p_decoder->pf_decode = NULL;



More information about the vlc-commits mailing list