Compare commits

...

1 Commits

Author SHA1 Message Date
oltolm
c7a53703b1 iR5900: fix heap-buffer-overflow in recompileNextInstruction 2024-08-10 17:47:39 -04:00

View File

@@ -1707,7 +1707,7 @@ void recompileNextInstruction(bool delayslot, bool swapped_delay_slot)
g_pCurInstInfo++;
// pc might be past s_nEndBlock if the last instruction in the block is a DI.
if (pc <= s_nEndBlock)
if (pc <= s_nEndBlock && (g_pCurInstInfo + (s_nEndBlock - pc) / 4 + 1) <= s_pInstCache + s_nInstCacheSize)
{
int count;
for (u32 i = 0; i < iREGCNT_GPR; ++i)