notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gpulib: fix frameskip on weird lists
[pcsx_rearmed.git]
/
libpcsxcore
/
ppf.c
diff --git
a/libpcsxcore/ppf.c
b/libpcsxcore/ppf.c
index
2ce1a9d
..
f37687c
100644
(file)
--- a/
libpcsxcore/ppf.c
+++ b/
libpcsxcore/ppf.c
@@
-21,6
+21,7
@@
#include "psxcommon.h"
#include "ppf.h"
#include "psxcommon.h"
#include "ppf.h"
+#include "misc.h"
#include "cdrom.h"
typedef struct tagPPF_DATA {
#include "cdrom.h"
typedef struct tagPPF_DATA {
@@
-356,6
+357,7
@@
fail_io:
// redump.org SBI files, slightly different handling from PCSX-Reloaded
unsigned char *sbi_sectors;
// redump.org SBI files, slightly different handling from PCSX-Reloaded
unsigned char *sbi_sectors;
+int sbi_len;
int LoadSBI(const char *fname, int sector_count) {
int good_sectors = 0;
int LoadSBI(const char *fname, int sector_count) {
int good_sectors = 0;
@@
-369,7
+371,8
@@
int LoadSBI(const char *fname, int sector_count) {
if (sbihandle == NULL)
return -1;
if (sbihandle == NULL)
return -1;
- sbi_sectors = calloc(1, sector_count / 8);
+ sbi_len = (sector_count + 7) / 8;
+ sbi_sectors = calloc(1, sbi_len);
if (sbi_sectors == NULL)
goto end;
if (sbi_sectors == NULL)
goto end;
@@
-413,15
+416,13
@@
int LoadSBI(const char *fname, int sector_count) {
break;
}
break;
}
- fclose(sbihandle);
- return 0;
-
end:
if (!clean_eof)
SysPrintf(_("SBI: parse failure at 0x%lx\n"), ftell(sbihandle));
if (!good_sectors) {
free(sbi_sectors);
sbi_sectors = NULL;
end:
if (!clean_eof)
SysPrintf(_("SBI: parse failure at 0x%lx\n"), ftell(sbihandle));
if (!good_sectors) {
free(sbi_sectors);
sbi_sectors = NULL;
+ sbi_len = 0;
}
fclose(sbihandle);
return sbi_sectors ? 0 : -1;
}
fclose(sbihandle);
return sbi_sectors ? 0 : -1;
@@
-431,5
+432,6
@@
void UnloadSBI(void) {
if (sbi_sectors) {
free(sbi_sectors);
sbi_sectors = NULL;
if (sbi_sectors) {
free(sbi_sectors);
sbi_sectors = NULL;
+ sbi_len = 0;
}
}
}
}