mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-22 16:18:50 -05:00
Fix AdpcmBook allocations (#2214)
This commit is contained in:
parent
a1a6c07549
commit
1a10d8f627
@ -127,7 +127,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 order;
|
||||
/* 0x04 */ s32 npredictors;
|
||||
/* 0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
|
||||
/* 0x08 */ s16 book[]; // size 8 * order * npredictors. 8-byte aligned
|
||||
} AdpcmBook; // size >= 0x8
|
||||
|
||||
typedef struct
|
||||
|
@ -1137,7 +1137,7 @@ extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path)
|
||||
sampleC->unk_bit26 = sample->unk_bit26;
|
||||
sampleC->unk_bit25 = sample->unk_bit25;
|
||||
|
||||
sampleC->book = new AdpcmBook[sample->book.books.size() * sizeof(int16_t)];
|
||||
sampleC->book = (AdpcmBook*) malloc(sizeof(AdpcmBook) + sample->book.books.size() * sizeof(int16_t));
|
||||
sampleC->book->npredictors = sample->book.npredictors;
|
||||
sampleC->book->order = sample->book.order;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user