all repos — mgba @ d14597f1eebfa67a69206898e671177d7af7672f

mGBA Game Boy Advance Emulator

Core: Fix crash modifying hash table entry (fixes #1673)
Vicki Pfau vi@endrift.com
Mon, 17 Feb 2020 17:55:29 -0800
commit

d14597f1eebfa67a69206898e671177d7af7672f

parent

7611913d65a6fb9eb448c97eacdc31616599b65e

2 files changed, 4 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -13,6 +13,7 @@ - GBA Video: Fix Hblank timing

Other fixes: - Core: Ensure ELF regions can be written before trying - Core: Fix ELF loading regression (fixes mgba.io/i/1669) + - Core: Fix crash modifying hash table entry (fixes mgba.io/i/1673) - Debugger: Don't skip undefined instructions when debugger attached - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) Misc:
M src/util/table.csrc/util/table.c

@@ -187,7 +187,9 @@ uint32_t hash = hash32(key, strlen(key), 0);

struct TableList* list; TABLE_LOOKUP_START(HASH_TABLE_COMPARATOR, list, hash) { if (value != lookupResult->value) { - table->deinitializer(lookupResult->value); + if (table->deinitializer) { + table->deinitializer(lookupResult->value); + } lookupResult->value = value; } return;