Fixed crash on selecting a Custom input color profile

see issue 1298
This commit is contained in:
Oliver Duis
2012-04-01 17:18:48 +02:00
parent fa33a880e7
commit 7d621effc7
2 changed files with 6 additions and 2 deletions

View File

@@ -453,6 +453,7 @@ DCPProfile* DCPStore::getStdProfile(Glib::ustring camShortName) {
}
bool DCPStore::isValidDCPFileName(Glib::ustring filename) const {
return safe_file_test (filename, Glib::FILE_TEST_EXISTS)
&& !filename.casefold().compare (filename.find_last_of ('.'), 4, ".dcp");
if (!safe_file_test (filename, Glib::FILE_TEST_EXISTS) || safe_file_test (filename, Glib::FILE_TEST_IS_DIR)) return false;
int pos=filename.find_last_of ('.');
return pos>0 && !filename.casefold().compare (pos, 4, ".dcp");
}