]> git.sesse.net Git - vlc/blobdiff - modules/misc/svg.c
Really fix the real overflow
[vlc] / modules / misc / svg.c
index 5841aebaf4a0e0629777af82cecfcfcbe2d73250..afaa6f7ea182dac4876c3b66b1c1695f0d87b571 100644 (file)
@@ -71,14 +71,14 @@ static char *svg_GetTemplate( vlc_object_t *p_this );
 #define TEMPLATE_LONGTEXT N_( "Location of a file holding a SVG template "\
         "for automatic string conversion" )
 
-vlc_module_begin();
- set_category( CAT_INPUT);
- set_category( SUBCAT_INPUT_SCODEC );
- set_capability( "text renderer", 99 );
- add_shortcut( "svg" );
- add_string( "svg-template-file", "", NULL, TEMPLATE_TEXT, TEMPLATE_LONGTEXT, true );
- set_callbacks( Create, Destroy );
-vlc_module_end();
+vlc_module_begin ()
+ set_category( CAT_INPUT)
+ set_category( SUBCAT_INPUT_SCODEC )
+ set_capability( "text renderer", 99 )
+ add_shortcut( "svg" )
+ add_string( "svg-template-file", "", NULL, TEMPLATE_TEXT, TEMPLATE_LONGTEXT, true )
+ set_callbacks( Create, Destroy )
+vlc_module_end ()
 
 /**
    Describes a SVG string to be displayed on the video
@@ -198,7 +198,7 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
                 msg_Dbg( p_this, "reading %ld bytes from template %s",
                          (unsigned long)s.st_size, psz_filename );
 
-                psz_template = malloc( ( s.st_size + 42 ) * sizeof( char ) );
+                psz_template = malloc( s.st_size + 42 );
                 if( !psz_template )
                 {
                     fclose( file );
@@ -471,7 +471,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         int length;
         char* psz_template = p_sys->psz_template;
         length = strlen( psz_string ) + strlen( psz_template ) + 42;
-        p_svg->psz_text = malloc( ( length + 1 ) * sizeof( char ) );
+        p_svg->psz_text = malloc( length + 1 );
         if( !p_svg->psz_text )
         {
             free( p_svg );