fixes for memory leaks and out of bounds memory access found by ASAN or gcc -flto

This commit is contained in:
kub 2020-12-12 14:57:56 +01:00
parent bb70cc6e66
commit a20300bf1e
8 changed files with 27 additions and 12 deletions

View file

@ -107,7 +107,7 @@ void Cz80_Init(cz80_struc *CPU)
for (i = 0; i < CZ80_FETCH_BANK; i++)
{
CPU->Fetch[i] = (FPTR)cz80_bad_address;
CPU->Fetch[i] = (FPTR)cz80_bad_address - (i << CZ80_FETCH_SFT);
#if CZ80_ENCRYPTED_ROM
CPU->OPFetch[i] = 0;
#endif