Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
louist103 committed Nov 28, 2024
1 parent 746f329 commit 158ac71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions soh/include/z64audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ typedef struct {
} AdsrEnvelope; // size = 0x4

typedef struct AdpcmLoop {
/* 0x00 */ uintptr_t start;
/* 0x04 */ uintptr_t loopEnd; // numSamples position into the sample where the loop ends
/* 0x00 */ u32 start;
/* 0x04 */ u32 loopEnd; // numSamples position into the sample where the loop ends
/* 0x08 */ u32 count; // The number of times the loop is played before the sound completes. Setting count to -1
// indicates that the loop should play indefinitely.
/* 0x0C */ u32 sampleEnd; // total number of s16-samples in the sample audio clip
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/resource/importer/AudioSampleFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLAudioSampleV0::ReadResource(s
size_t numBooks = audioSample->book.npredictors * audioSample->book.order * 8;
audioSample->book.book = new int16_t[numBooks];
while (book != nullptr) {
audioSample->book.book[i] = book->IntAttribute("Page");
audioSample->book.book[i++] = book->IntAttribute("Page");
book = book->NextSiblingElement();
}
audioSample->sample.book = &audioSample->book;
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/resource/type/AudioSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SOH {
AudioSample::~AudioSample() {
if (sample.book->book != nullptr) {
if (sample.book != nullptr && sample.book->book != nullptr) {
delete[] sample.book->book;
}
if (sample.sampleAddr != nullptr) {
Expand Down

0 comments on commit 158ac71

Please sign in to comment.