[vlc-commits] ttml codec: Fix potential leak

Hugo Beauzée-Luyssen git at videolan.org
Fri Sep 16 18:07:55 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Sep 16 13:43:57 2016 +0200| [4894beebac6b8c83de593ba05062916f9b36271a] | committer: Hugo Beauzée-Luyssen

ttml codec: Fix potential leak

Fix cid #1346962

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

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

diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index 2a0d23b..fcdaf90 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -658,7 +658,10 @@ static text_segment_t *ParseTTMLSubtitles( decoder_t *p_dec, subpicture_updater_
                 {
                     char* psz_text = NULL;
                     if( asprintf( &psz_text, "%s%s%s", p_bidi[i_direction].psz_uni_start, p_segment->psz_text, p_bidi[i_direction].psz_uni_end ) < 0 )
+                    {
+                        text_segment_Delete( p_segment );
                         goto fail;
+                    }
 
                     free( p_segment->psz_text );
                     p_segment->psz_text = psz_text;



More information about the vlc-commits mailing list