From ff82e53b85d714b0f5f6d9832ed4b9e21e3c5a52 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 21 Feb 2024 13:38:39 +0100 Subject: [PATCH] Revert "Sanitize the AAF's snapshot name (it'll get used later to create an OS folder)" This reverts commit b935710b60c7eca9799fc56f7a9bc7848e661682. legalize_for_universal_path() already santizes the path in a way that is safe for all OS. laaf_util_clean_filename() cannot be used with .c_str() because the function modifies the char* passed to it. This worked in some cases before C++11, and can work with non-const std::string::data starting at C++17, but C++11 spec is quite clear: > The program shall not modify any of the values stored in the > character array; otherwise, the behavior is undefined. --- gtk2_ardour/ardour_ui_aaf.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/gtk2_ardour/ardour_ui_aaf.cc b/gtk2_ardour/ardour_ui_aaf.cc index a293715b31..8633dd61b7 100644 --- a/gtk2_ardour/ardour_ui_aaf.cc +++ b/gtk2_ardour/ardour_ui_aaf.cc @@ -402,7 +402,6 @@ ARDOUR_UI::new_session_from_aaf (string const& aaf, string const& target_dir, st snapshot = basename_nosuffix (aaf); } - snapshot = laaf_util_clean_filename((char *)snapshot.c_str()); snapshot = legalize_for_universal_path (snapshot); path = Glib::build_filename (target_dir, snapshot);