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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* CD-ROM image support.
|
||||
*
|
||||
* Version: @(#)cdrom_image.cc 1.0.5 2018/10/21
|
||||
* Version: @(#)cdrom_image.cc 1.0.6 2018/10/21
|
||||
*
|
||||
* Author: RichardG867,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -1084,6 +1084,7 @@ cdrom_image_open(cdrom_t *dev, const wchar_t *fn)
|
||||
if (!img->SetDevice(temp, false)) {
|
||||
cdrom_image_close(dev);
|
||||
cdrom->ops = NULL;
|
||||
cdrom->host_drive = 0;
|
||||
cdrom_image_log("[f] image_open(): cdrom[%i]->ops = %08X\n", dev->id, dev->ops);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user