A few fixes, CD-ROM ejecting/reloading should no longer cause heap problems because they now allocate prev_image_path with the correct length, and the status bar should now work after a hard reset with no config change.

This commit is contained in:
OBattler
2018-10-21 22:09:18 +02:00
parent c182b9f269
commit f088896a74
6 changed files with 29 additions and 17 deletions

View File

@@ -8,7 +8,7 @@
*
* Generic CD-ROM drive core.
*
* Version: @(#)cdrom.c 1.0.2 2018/10/17
* Version: @(#)cdrom.c 1.0.3 2018/10/21
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -300,7 +300,7 @@ cdrom_eject(uint8_t id)
}
if (dev->host_drive == 200) {
dev->prev_image_path = (wchar_t *) malloc(1024);
dev->prev_image_path = (wchar_t *) malloc(1024 * sizeof(wchar_t));
wcscpy(dev->prev_image_path, dev->image_path);
}