[Core/CD] fixed CD hardware buffer initialization when using dynamic memory allocation

This commit is contained in:
EkeEke 2017-08-15 11:00:47 +02:00
parent f5c826731d
commit f5e425b92a
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
* ROM Loading Support * ROM Loading Support
* *
* Copyright (C) 1998-2003 Charles Mac Donald (original code) * Copyright (C) 1998-2003 Charles Mac Donald (original code)
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2017 Eke-Eke (Genesis Plus GX)
* *
* Redistribution and use of this code or any derivative works are permitted * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met:
@ -534,8 +534,8 @@ int load_rom(char *filename)
#ifdef USE_DYNAMIC_ALLOC #ifdef USE_DYNAMIC_ALLOC
if (!ext) if (!ext)
{ {
/* allocate memory for Cartridge / CD hardware if required */ /* allocate & initialize memory for Cartridge / CD hardware if required */
ext = (external_t *)malloc(sizeof(external_t)); ext = (external_t *)calloc(1, sizeof(external_t));
if (!ext) return (0); if (!ext) return (0);
} }
#endif #endif

View File

@ -3,7 +3,7 @@
* ROM Loading Support * ROM Loading Support
* *
* Copyright (C) 1998-2003 Charles Mac Donald (original code) * Copyright (C) 1998-2003 Charles Mac Donald (original code)
* Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2017 Eke-Eke (Genesis Plus GX)
* *
* Redistribution and use of this code or any derivative works are permitted * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met: