BackgroundAudio Atrac3+: malloc a few extra bytes. Fixes crash reported by Verymelon

This commit is contained in:
Henrik Rydgård 2024-01-26 19:42:25 +01:00
parent 3ee3af2dff
commit 1a1b79606b

View File

@ -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) {