mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2025-01-26 09:55:27 +01:00
[Core/CD] fixed CHD data initialization (fixes potential crashes when loading non-CHD CD image files after 10MB ROM file)
This commit is contained in:
parent
ae28f87402
commit
724015c5a5
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
Binary file not shown.
Before Width: | Height: | Size: 3.5 MiB After Width: | Height: | Size: 3.5 MiB |
@ -2,7 +2,7 @@
|
|||||||
* Genesis Plus
|
* Genesis Plus
|
||||||
* CD drive processor & CD-DA fader
|
* CD drive processor & CD-DA fader
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-2017 Eke-Eke (Genesis Plus GX)
|
* Copyright (C) 2012-2018 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:
|
||||||
@ -1169,7 +1169,6 @@ void cdd_unload(void)
|
|||||||
chd_close(cdd.chd.file);
|
chd_close(cdd.chd.file);
|
||||||
if (cdd.chd.hunk)
|
if (cdd.chd.hunk)
|
||||||
free(cdd.chd.hunk);
|
free(cdd.chd.hunk);
|
||||||
memset(&cdd.chd, 0x00, sizeof(cdd.chd));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* close CD tracks */
|
/* close CD tracks */
|
||||||
@ -1210,6 +1209,11 @@ void cdd_unload(void)
|
|||||||
/* reset TOC */
|
/* reset TOC */
|
||||||
memset(&cdd.toc, 0x00, sizeof(cdd.toc));
|
memset(&cdd.toc, 0x00, sizeof(cdd.toc));
|
||||||
|
|
||||||
|
#if defined(USE_LIBCHDR)
|
||||||
|
/* reset CHD data */
|
||||||
|
memset(&cdd.chd, 0x00, sizeof(cdd.chd));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* no CD-ROM track */
|
/* no CD-ROM track */
|
||||||
cdd.sectorSize = 0;
|
cdd.sectorSize = 0;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* Genesis Plus
|
* Genesis Plus
|
||||||
* CD drive processor & CD-DA fader
|
* CD drive processor & CD-DA fader
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-2017 Eke-Eke (Genesis Plus GX)
|
* Copyright (C) 2012-2018 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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user