diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 969667ddba..fc9ca3cc70 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -331,7 +331,7 @@ AudioFileSource::safe_audio_file_extension(const string& file) ".smp", ".SMP", ".snd", ".SND", ".maud", ".MAUD", - ".voc", ".VOC" + ".voc", ".VOC", ".vwe", ".VWE", ".w64", ".W64", ".wav", ".WAV", @@ -352,7 +352,8 @@ AudioFileSource::safe_audio_file_extension(const string& file) }; for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) { - if (file.rfind (suffixes[n]) == file.length() - strlen (suffixes[n])) { + size_t pos = file.rfind (suffixes[n]); + if (pos > 0 && pos == file.length() - strlen(suffixes[n])) { return true; } } diff --git a/libs/ardour/ffmpegfilesource.cc b/libs/ardour/ffmpegfilesource.cc index 638506124f..fceaf7017e 100644 --- a/libs/ardour/ffmpegfilesource.cc +++ b/libs/ardour/ffmpegfilesource.cc @@ -85,7 +85,8 @@ FFMPEGFileSource::safe_audio_file_extension (const std::string &file) }; for (size_t n = 0; n < sizeof(suffixes) / sizeof(suffixes[0]); ++n) { - if (file.rfind(suffixes[n]) == file.length() - strlen(suffixes[n])) { + size_t pos = file.rfind (suffixes[n]); + if (pos > 0 && pos == file.length() - strlen(suffixes[n])) { return true; } }