mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
fix underalloc
This commit is contained in:
parent
d1b8bcc634
commit
8f80007bcc
1 changed files with 4 additions and 2 deletions
|
@ -302,7 +302,8 @@ void SekRegisterIdleHit(unsigned int pc)
|
|||
|
||||
void SekInitIdleDet(void)
|
||||
{
|
||||
unsigned short **tmp = realloc(idledet_ptrs, 0x200*4);
|
||||
unsigned short **tmp;
|
||||
tmp = realloc(idledet_ptrs, 0x200 * sizeof(tmp[0]));
|
||||
if (tmp == NULL) {
|
||||
free(idledet_ptrs);
|
||||
idledet_ptrs = NULL;
|
||||
|
@ -410,7 +411,8 @@ int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx)
|
|||
}
|
||||
|
||||
if (idledet_count >= 0x200 && (idledet_count & 0x1ff) == 0) {
|
||||
unsigned short **tmp = realloc(idledet_ptrs, (idledet_count+0x200)*4);
|
||||
unsigned short **tmp;
|
||||
tmp = realloc(idledet_ptrs, (idledet_count+0x200) * sizeof(tmp[0]));
|
||||
if (tmp == NULL)
|
||||
return 1;
|
||||
idledet_ptrs = tmp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue