]> git.sesse.net Git - mlt/commitdiff
mlt_factory.c: guard against accessing mlt_environment before it is ready
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 2 Feb 2008 08:57:24 +0000 (08:57 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 2 Feb 2008 08:57:24 +0000 (08:57 +0000)
mlt_profile.c: fix setting legacy MLT_NORMALISATION on mlt_environment

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1053 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_factory.c
src/framework/mlt_profile.c

index 0b4508c505b2a8615fb1333cb989dd5edd48213f..4a14decc98ef02ed28e9335b81a629522d68ca7a 100644 (file)
@@ -139,7 +139,10 @@ const char *mlt_factory_prefix( )
 
 char *mlt_environment( const char *name )
 {
-       return mlt_properties_get( global_properties, name );
+       if ( global_properties )
+               return mlt_properties_get( global_properties, name );
+       else
+               return NULL;
 }
 
 /** Set a value in the environment.
index b9e230f68b834d5b85fdf72a2e1823c8e5de77b5..960550e8ce2c71d613ac0be249a8ba3b462a1a71 100644 (file)
@@ -144,7 +144,7 @@ mlt_profile mlt_profile_load_file( const char *file )
        }
 
        // Set MLT_NORMALISATION to appease legacy modules
-       char *profile_name = getenv( "MLT_PROFILE" );
+       char *profile_name = mlt_environment( "MLT_PROFILE" );
        if ( profile_name )
        {
                if ( strstr( profile_name, "_ntsc" ) ||