Skip to content

Commit

Permalink
BackgroundAudio Atrac3+: malloc a few extra bytes. Fixes crash report…
Browse files Browse the repository at this point in the history
…ed by Verymelon
  • Loading branch information
hrydgard committed Jan 26, 2024
1 parent 3ee3af2 commit 1a1b796
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion UI/BackgroundAudio.cpp
Expand Up @@ -146,7 +146,9 @@ void WavData::Read(RIFFReader &file_) {
int numBytes = file_.GetCurrentChunkSize();
numFrames = numBytes / raw_bytes_per_frame; // numFrames

raw_data = (uint8_t *)malloc(numBytes);
// It seems the atrac3 codec likes to read a little bit outside.
int padding = 16;
raw_data = (uint8_t *)malloc(numBytes + padding);
raw_data_size = numBytes;

if (num_channels == 1 || num_channels == 2) {
Expand Down

0 comments on commit 1a1b796

Please sign in to comment.