Merge branch 'main' into fontlib

This commit is contained in:
Valdis Bogdāns 2026-01-17 10:53:18 +02:00 committed by GitHub
commit aaf1471346
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,15 @@ AvPlayerSourceType GetSourceType(std::string_view path) {
}
// schema://server.domain/path/to/file.ext/and/beyond -> .ext/and/beyond
auto ext = name.substr(name.rfind('.'));
// Find extension dot
auto dot_pos = name.rfind('.');
if (dot_pos == std::string_view::npos) {
return AvPlayerSourceType::Unknown;
}
// Extract extension (".ext/anything" or ".ext")
auto ext = name.substr(dot_pos);
if (ext.empty()) {
return AvPlayerSourceType::Unknown;
}