From 638453131714b4bc5305fd9a7fa50447b2edd07f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 27 Mar 2022 01:39:31 +0900 Subject: [PATCH] Fix LogoVisualisation draw thread safety --- osu.Game/Screens/Menu/LogoVisualisation.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 4acd73bfa0..34f1d46067 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -176,7 +176,7 @@ namespace osu.Game.Screens.Menu private static readonly Color4 transparent_white = Color4.White.Opacity(0.2f); - private float[] audioData; + private readonly float[] audioData = new float[256]; private readonly QuadBatch vertexBatch = new QuadBatch(100, 10); @@ -192,7 +192,8 @@ namespace osu.Game.Screens.Menu shader = Source.shader; texture = Source.texture; size = Source.DrawSize.X; - audioData = Source.frequencyAmplitudes; + + Source.frequencyAmplitudes.AsSpan().CopyTo(audioData); } public override void Draw(Action vertexAction)