Skip to content

Commit

Permalink
πŸ› Fix crash in sample_unaltered_volume() when there is no audio data
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Oct 27, 2023
1 parent 18efb5d commit 5e3ca40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ auto Player::sample(int64_t frame_index, int64_t channel_index) const -> float

auto Player::sample_unaltered_volume(int64_t frame_index, int64_t channel_index) const -> float
{
if (!has_audio_data())
return 0.f;

auto const sample_index = frame_index * _data.channels_count
+ channel_index % _data.channels_count;
if ((sample_index < 0
Expand Down

0 comments on commit 5e3ca40

Please sign in to comment.