diff --git a/src/emu/bus/pce/pce_slot.c b/src/emu/bus/pce/pce_slot.c index aaf4ab63257..611525a6a53 100644 --- a/src/emu/bus/pce/pce_slot.c +++ b/src/emu/bus/pce/pce_slot.c @@ -309,11 +309,11 @@ int pce_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) type = PCE_POPULOUS; // Check for CD system card v3 which adds on-cart RAM to the system - if (!memcmp(ROM + 0x3FFB6, "PC Engine CD-ROM SYSTEM", 23)) + if (len >= 0x3ffb6 + 23 && !memcmp(ROM + 0x3ffb6, "PC Engine CD-ROM SYSTEM", 23)) { /* Check if 192KB additional system card ram should be used */ - if(!memcmp(ROM + 0x29D1, "VER. 3.", 7)) { type = PCE_CDSYS3J; } // JP version - else if(!memcmp(ROM + 0x29C4, "VER. 3.", 7 )) { type = PCE_CDSYS3U; } // US version + if (!memcmp(ROM + 0x29d1, "VER. 3.", 7)) { type = PCE_CDSYS3J; } // JP version + else if (!memcmp(ROM + 0x29c4, "VER. 3.", 7 )) { type = PCE_CDSYS3U; } // US version } return type;