filter-displacement: Do not allow zero-length file names

Fixes a crash when using c_str() on an empty string, causing an unexpected crash.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-04-23 17:00:18 +02:00
parent b4341e41b3
commit bbcde070f3

View file

@ -160,6 +160,11 @@ void filter::displacement::displacement_instance::validate_file_texture(std::str
{ {
bool do_update = false; bool do_update = false;
// Don't allow empty file names.
if (file.length() == 0) {
return;
}
// File name different // File name different
if (file != m_file_name) { if (file != m_file_name) {
do_update = true; do_update = true;