From a6ed6cde1ed94030ad3e181cd6e040c09815a91c Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 16 Mar 2018 19:03:20 +0100 Subject: [PATCH] The IDE buffer is now correctly allocated at a size of 65536 words rather than bytes, fixes crashes with some machines. --- src/disk/hdc_ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index b2743528b..d07532abd 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -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, * Miran Grca, @@ -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]);