2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-03-05 04:23:02 +00:00

fix: not properly respecting code const array boundaries when dumping techniques

This commit is contained in:
Jan Laupetin
2026-03-01 16:39:00 +01:00
parent d0ee167d2d
commit 12199b5395

View File

@@ -52,8 +52,9 @@ namespace techset
{
for (const auto& codeConstSourceInfo : m_code_const_source_infos)
{
const auto codeConstSourceInfoEnd = static_cast<unsigned>(codeConstSourceInfo.value) + codeConstSourceInfo.arrayCount;
if (codeConstSourceInfo.value <= codeConstSource && codeConstSourceInfoEnd >= codeConstSource)
const auto arrayCount = std::max<uint8_t>(codeConstSourceInfo.arrayCount, 1);
const auto codeConstSourceInfoEnd = static_cast<unsigned>(codeConstSourceInfo.value) + arrayCount;
if (codeConstSourceInfo.value <= codeConstSource && codeConstSourceInfoEnd > codeConstSource)
return codeConstSourceInfo;
if (codeConstSourceInfoEnd > codeConstSource)