From: ddennedy Date: Sat, 2 Feb 2008 08:57:24 +0000 (+0000) Subject: mlt_factory.c: guard against accessing mlt_environment before it is ready X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=9bee7421e4b65a36f9977482a88027e8a5260eeb;p=melted mlt_factory.c: guard against accessing mlt_environment before it is ready 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 --- diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index 0b4508c..4a14dec 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -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. diff --git a/src/framework/mlt_profile.c b/src/framework/mlt_profile.c index b9e230f..960550e 100644 --- a/src/framework/mlt_profile.c +++ b/src/framework/mlt_profile.c @@ -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" ) ||