]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_property.c
mlt_property_get_time(): get mutex before accessing self->types
[mlt] / src / framework / mlt_property.c
index 7a518ff443598d2977e02e7a05ee1a48f78b1d0b..4d5f57c7c53ed84c1c7acadc77e90e6c0beaf796 100644 (file)
@@ -864,6 +864,11 @@ char *mlt_property_get_time( mlt_property self, mlt_time_format format, double f
                // Set the new locale
                setlocale( LC_NUMERIC, localename );
        }
+       else
+       {
+               // Make sure we have a lock before accessing self->types
+               pthread_mutex_lock( &self->mutex );
+       }
 
        // Convert number to string
        if ( self->types & mlt_prop_int )
@@ -910,6 +915,11 @@ char *mlt_property_get_time( mlt_property self, mlt_time_format format, double f
                free( orig_localename );
                pthread_mutex_unlock( &self->mutex );
        }
+       else
+       {
+               // Make sure we have a lock before accessing self->types
+               pthread_mutex_unlock( &self->mutex );
+       }
 
        // Return the string (may be NULL)
        return self->prop_string;