[vlc-commits] demux: avformat: fix leak in subs extradata

Francois Cartegnie git at videolan.org
Thu Jul 5 22:46:11 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul  5 22:20:00 2018 +0200| [188ce2351f78b783a5159646fed75078db4b7b70] | committer: Francois Cartegnie

demux: avformat: fix leak in subs extradata

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

 modules/demux/avformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index ed15b4f08d..8f44a00dd1 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -654,7 +654,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
                     es_fmt.p_extra = NULL;
                 }
             }
-            else if( cp->extradata_size > 0 )
+            else if( cp->extradata_size > 0 && !es_fmt.i_extra )
             {
                 es_fmt.p_extra = malloc( i_extra );
                 if( es_fmt.p_extra )



More information about the vlc-commits mailing list