mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 12:12:16 +00:00

The crash was not systematic but occured in the case where adding the game did not change the indexes for the first and last visible items. The issue was that in setEntryList() was called it did not cleat the _visibleEntryList array that still contained dangling pointers to the old items in the _dataEntryList. In most cases the _visibleEntryList would be updated with pointers to the new items when calcVisibleEntries() was called from reflowLayout(), before being used in assignEntriesToItems() (also called from reflowLayout()). But if the indexes of the first and last visible items did not change, _visibleEntryList was not updated and we got a crash in assignEntriesToItems() when trying to access freed memory.