Skip to content

Commit

Permalink
Merge pull request #2381 from giomasce/bit_array
Browse files Browse the repository at this point in the history
Fix a crash when searching the first enabled bit in a completely disabled bit array
  • Loading branch information
billhollings authored Oct 18, 2024
2 parents a8ebcfd + 26689ac commit 3422ca2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MoltenVK/MoltenVK/Utility/MVKBitArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class MVKBitArray {
secIdx = _fullyDisabledSectionCount;
startIndex = 0;
}
if (secIdx >= getSectionCount()) { return _bitCount; }
return std::min((secIdx * SectionBitCount) + getIndexOfFirstEnabledBitInSection(getSection(secIdx), getBitIndexInSection(startIndex)), _bitCount);
}

Expand Down

0 comments on commit 3422ca2

Please sign in to comment.