From 71f452aa1272eec0aa943ae579c6b5417fc204a6 Mon Sep 17 00:00:00 2001 From: Lawrence37 <45837045+Lawrence37@users.noreply.github.com> Date: Mon, 27 May 2024 11:13:09 -0700 Subject: [PATCH] Fix crash when trying to load DCP (#7039) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stream a C-string of the file name instead of the Glib::ustring. The ustring can throw an exception with certain locale settings and file name character combinations, such as with LANG=es_ES and the character "รค". Only print the message if verbose is true. --- rtengine/dcp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index df5627d2e..96ade2e36 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -1177,7 +1177,9 @@ DCPProfile::DCPProfile(const Glib::ustring& filename) : // Color Matrix (one is always there) if (!md.find(TAG_KEY_COLOR_MATRIX_1)) { - std::cerr << "DCP '" << filename << "' is missing 'ColorMatrix1'. Skipped." << std::endl; + if (settings->verbose) { + std::cerr << "DCP '" << filename.c_str() << "' is missing 'ColorMatrix1'. Skipped." << std::endl; + } return; }