]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_profile.c
mlt_profile.c: bugfix string allocation length
[mlt] / src / framework / mlt_profile.c
index c9c67d26f6b1b7a4b62731bc35cc7dd9315a1112..8d0e07122317fd335f914ed08a07793c8281f90f 100644 (file)
@@ -64,7 +64,7 @@ mlt_profile mlt_profile_get( )
 mlt_profile mlt_profile_select( const char *name )
 {
        const char *prefix = PREFIX;
-       char *filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + strlen( name ) + 1 );
+       char *filename = calloc( 1, strlen( prefix ) + strlen( PROFILES_DIR ) + strlen( name ) + 2 );
        strcpy( filename, prefix );
        if ( filename[ strlen( filename ) - 1 ] != '/' )
                filename[ strlen( filename ) ] = '/';
@@ -102,15 +102,14 @@ mlt_profile mlt_profile_load_file( const char *file )
        // Set MLT_NORMALISATION to appease legacy modules
        char *profile_name = mlt_environment( "MLT_PROFILE" );
        if ( strstr( profile_name, "_ntsc" ) ||
-            strstr( profile_name, "_atsc" ) ||
-            strstr( profile_name, "_60i" ) ||
-            strstr( profile_name, "_30p" ) )
+            strstr( profile_name, "_60" ) ||
+            strstr( profile_name, "_30" ) )
        {
                mlt_environment_set( "MLT_NORMALISATION", "NTSC" );
        }
        else if ( strstr( profile_name, "_pal" ) ||
-                 strstr( profile_name, "_50i" ) ||
-                 strstr( profile_name, "_25p" ) )
+                 strstr( profile_name, "_50" ) ||
+                 strstr( profile_name, "_25" ) )
        {
                mlt_environment_set( "MLT_NORMALISATION", "PAL" );
        }