[vlc-commits] demux: subtitle: fix unchecked alloc

Francois Cartegnie git at videolan.org
Tue Jan 24 17:31:47 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 24 17:29:10 2017 +0100| [276823e9f484d1f1a9274ed312d7eba219a2c885] | committer: Francois Cartegnie

demux: subtitle: fix unchecked alloc

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

 modules/demux/subtitle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 782f6f1..7c54277 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -598,10 +598,10 @@ static int Open ( vlc_object_t *p_this )
         fmt.psz_description = psz_description;
     else
         free( psz_description );
-    if( p_sys->props.psz_header != NULL )
+    if( p_sys->props.psz_header != NULL &&
+       (fmt.p_extra = strdup( p_sys->props.psz_header )) )
     {
         fmt.i_extra = strlen( p_sys->props.psz_header ) + 1;
-        fmt.p_extra = strdup( p_sys->props.psz_header );
     }
 
     p_sys->es = es_out_Add( p_demux->out, &fmt );



More information about the vlc-commits mailing list