The IDE buffer is now correctly allocated at a size of 65536 words rather than bytes, fixes crashes with some machines.

This commit is contained in:
OBattler
2018-03-16 19:03:20 +01:00
parent 86a3941093
commit a6ed6cde1e

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.34 2018/03/15
* Version: @(#)hdc_ide.c 1.0.35 2018/03/16
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -885,7 +885,7 @@ void ide_reset(void)
if (ide_drives[d].type != IDE_NONE) {
ide_drives[d].buffer = NULL; /* Important, makes sure malloc does not reuse an existing pointer from elsewhere. */
ide_drives[d].buffer = (uint16_t *) malloc(65536);
ide_drives[d].buffer = (uint16_t *) malloc(65536 * sizeof(uint16_t));
}
ide_set_signature(&ide_drives[d]);