Skip to content

Commit

Permalink
Fix crash when using REMOUNT command on drive beyond D:
Browse files Browse the repository at this point in the history
  • Loading branch information
schellingb committed May 15, 2024
1 parent 3c0d751 commit 640452c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dosbox_pure_libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,9 @@ static void DBP_Remount(char drive1, char drive2)
else
{
// Swap registration with BIOS/CMOS
if (imageDisk*& dsk = imageDiskList[drive1-'A'])
if (drive1 < 'A'+MAX_DISK_IMAGES && imageDiskList[drive1-'A'])
{
imageDisk*& dsk = imageDiskList[drive1-'A'];
if (drive2 < 'A'+MAX_DISK_IMAGES) imageDiskList[drive2-'A'] = dsk;
else if (!dynamic_cast<fatDrive*>(Drives[drive1-'A'])) delete dsk;
dsk = NULL;
Expand Down

0 comments on commit 640452c

Please sign in to comment.