Skip to content

Commit

Permalink
Fixed audio processing
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Jan 16, 2025
1 parent 7da8ae8 commit b96910b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Companion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,9 +1507,9 @@ std::optional<YAML::Node> Companion::AddAsset(YAML::Node asset) {
auto found = std::get<1>(decl.value());
if(GetSafeNode<std::string>(found, "type") != type) {
SPDLOG_ERROR("Asset clash detected {} vs {} at 0x{:X}", type, GetSafeNode<std::string>(found, "type"), offset);
} else {
return found;
}

return found;
}

auto rom = this->GetRomData();
Expand Down
4 changes: 4 additions & 0 deletions src/factories/naudio/v1/BookFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ std::optional<std::shared_ptr<IParsedData>> ADPCMBookFactory::parse(std::vector<
book->numPredictors = reader.ReadInt32();
size_t length = 8 * book->order * book->numPredictors;

if(length > 0x40){
return std::nullopt;
}

for(size_t i = 0; i < length; i++){
book->book.push_back(reader.ReadInt16());
}
Expand Down

0 comments on commit b96910b

Please sign in to comment.