1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:23:22 +08:00

Do not attempt to pass files that don't look like audio to BASS

This commit is contained in:
Bartłomiej Dach 2024-04-22 10:45:09 +02:00
parent b28bf4d2ec
commit 70a5288a68
No known key found for this signature in database

View File

@ -37,14 +37,16 @@ namespace osu.Game.Rulesets.Edit.Checks
if (data == null)
continue;
if (!AudioCheckUtils.HasAudioExtension(file.Filename) || !probablyHasAudioData(data))
continue;
var fileCallbacks = new FileCallbacks(new DataStreamFileProcedures(data));
int decodeStream = Bass.CreateStream(StreamSystem.NoBuffer, BassFlags.Decode, fileCallbacks.Callbacks, fileCallbacks.Handle);
// If the format is not supported by BASS
if (decodeStream == 0)
{
if (AudioCheckUtils.HasAudioExtension(file.Filename) && probablyHasAudioData(data))
yield return new IssueTemplateFormatUnsupported(this).Create(file.Filename);
yield return new IssueTemplateFormatUnsupported(this).Create(file.Filename);
continue;
}