mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 15:19:53 -06:00
fix out of bounds read
This commit is contained in:
@ -51,9 +51,14 @@ struct NonStupidBitField
|
||||
template <typename T>
|
||||
void Next()
|
||||
{
|
||||
while (RemainingBits == 0 && DataIdx < DataLength)
|
||||
if (DataIdx >= DataLength)
|
||||
return;
|
||||
|
||||
while (RemainingBits == 0)
|
||||
{
|
||||
DataIdx += sizeof(T);
|
||||
if (DataIdx >= DataLength)
|
||||
return;
|
||||
RemainingBits = *(T*)&BitField.Data[DataIdx];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user