X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fppf.c;h=f6ccfca7e8101a7be8af7a11d952c2c469b5c9a3;hb=2e6a3b0ee60c654873ca836d3f18ba9f57880fb4;hp=0d80107b5cc50b97bcfe19c5b6b0d686384e10e1;hpb=eaa895dc8ff02d63cf52b5d0faf0d8272a96a822;p=pcsx_rearmed.git diff --git a/libpcsxcore/ppf.c b/libpcsxcore/ppf.c index 0d80107b..f6ccfca7 100644 --- a/libpcsxcore/ppf.c +++ b/libpcsxcore/ppf.c @@ -183,7 +183,7 @@ void BuildPPFCache() { char method, undo = 0, blockcheck = 0; int dizlen, dizyn; unsigned char ppfmem[512]; - char szPPF[MAXPATHLEN]; + char szPPF[MAXPATHLEN * 2]; int count, seekpos, pos; u32 anz; // use 32-bit to avoid stupid overflows s32 ladr, off, anx; @@ -347,8 +347,10 @@ int LoadSBI(const char *fname, int sector_count) { return -1; sbi_sectors = calloc(1, sector_count / 8); - if (sbi_sectors == NULL) + if (sbi_sectors == NULL) { + fclose(sbihandle); return -1; + } // 4-byte SBI header fread(buffer, 1, 4, sbihandle);