[vlc-commits] ttml codec: Fix leak on error

2016-09-15 Thread Hugo Beauzée-Luyssen
vlc | branch: master | Hugo Beauzée-Luyssen  | Thu Sep 15 
12:35:35 2016 +0200| [edb70ceaf74cf81a09d4fc4b9c820231bdae4016] | committer: 
Hugo Beauzée-Luyssen

ttml codec: Fix leak on error

fix cid #1372943

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

 modules/codec/substtml.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index 8f23b42..99462ba 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -259,7 +259,10 @@ static ttml_style_t* ParseTTMLStyle( decoder_t *p_dec, 
xml_reader_t* p_reader, c
 char *tmp;
 char *value = strdup( val );
 if( unlikely( value == NULL ) )
+{
+CleanupStyle( p_ttml_style );
 return NULL;
+}
 
 char *token = strtok_r( value , " ",  );
 ttml_style_t* p_style = FindTextStyle( p_dec, token );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] ttml codec: Fix leak on error

2016-09-15 Thread Hugo Beauzée-Luyssen
vlc | branch: master | Hugo Beauzée-Luyssen  | Thu Sep 15 
11:14:56 2016 +0200| [17b1391123ae40fa094353a0a4bc87d61372bd99] | committer: 
Hugo Beauzée-Luyssen

ttml codec: Fix leak on error

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

 modules/codec/substtml.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index ff7b987..b45d8e4 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -588,7 +588,10 @@ static text_segment_t *ParseTTMLSubtitles( decoder_t 
*p_dec, subpicture_updater_
  MergeTTMLStyle( p_style, p_style_stack->p_style );
 
 if( PushStyle( _style_stack, p_style ) == false )
+{
+CleanupStyle( p_style );
 goto fail;
+}
 
 }
 else if( i_type == XML_READER_TEXT )

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits