Skip to content

Commit d14a13b

Browse files
committed
Fix waveform rendering crash on loading mp3 audio
1 parent 8ec05f9 commit d14a13b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Editor/Waveform.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ void sampleEdges(WaveEdge* edges, int w, int h, int channel, int blockId, bool f
457457
return;
458458
}
459459

460+
// A crash can occur if another thread is loading the audio. Just do nothing if it is.
461+
if (!music.isAllocated())
462+
{
463+
return;
464+
}
465+
460466
double sampleSkip = max(0.001, (samplesPerPixel / 200.0));
461467
int wh = w / 2 - 1;
462468

0 commit comments

Comments
 (0)