mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
fixes for memory leaks and out of bounds memory access found by ASAN or gcc -flto
This commit is contained in:
parent
bb70cc6e66
commit
a20300bf1e
8 changed files with 27 additions and 12 deletions
|
@ -941,6 +941,7 @@ void cdd_process(void)
|
|||
case 0x01: /* Current Track Relative Time (MM:SS:FF) */
|
||||
{
|
||||
int lba = cdd.lba - cdd.toc.tracks[cdd.index].start;
|
||||
if (lba < 0) lba = 0;
|
||||
set_reg16(0x38, (cdd.status << 8) | 0x01);
|
||||
set_reg16(0x3a, lut_BCD_16[(lba/75)/60]);
|
||||
set_reg16(0x3c, lut_BCD_16[(lba/75)%60]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue