[vlc-commits] ttml codec: add memory allocation error

Stanislas Plessia git at videolan.org
Wed Sep 14 18:39:44 CEST 2016


vlc | branch: master | Stanislas Plessia <stplessia at gmail.com> | Mon Aug 29 16:01:12 2016 +0200| [7d014b8136ca5d470d7177a08db72886254198bf] | committer: Hugo Beauzée-Luyssen

ttml codec: add memory allocation error

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

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

diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index 196447c..f53c897 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -266,6 +266,11 @@ static ttml_style_t* ParseTTMLStyle( decoder_t *p_dec, xml_reader_t* p_reader, c
         {
             free( p_ttml_style->font_style->psz_fontname );
             p_ttml_style->font_style->psz_fontname = strdup( val );
+            if( unlikely( p_ttml_style->font_style->psz_fontname == NULL ) )
+            {
+                CleanupStyle( p_ttml_style );
+                return NULL;
+            }
         }
         else if( !strcasecmp( "tts:opacity", attr ) )
         {



More information about the vlc-commits mailing list