Applied Chrono's UPS Fix patch
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@901 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
29808dbcc0
commit
b18b0c6d13
|
@ -232,16 +232,25 @@ static bool patchApplyUPS(const char *patchname, u8 **rom, int *size)
|
||||||
s64 dstSize = readVarPtr(f);
|
s64 dstSize = readVarPtr(f);
|
||||||
|
|
||||||
if (crc == srcCRC) {
|
if (crc == srcCRC) {
|
||||||
dataSize = srcSize;
|
if (srcSize != *size) {
|
||||||
} else if (crc == dstCRC) {
|
fclose(f);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
dataSize = dstSize;
|
dataSize = dstSize;
|
||||||
|
} else if (crc == dstCRC) {
|
||||||
|
if (dstSize != *size) {
|
||||||
|
fclose(f);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
dataSize = srcSize;
|
||||||
} else {
|
} else {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (dataSize != *size) {
|
if (dataSize > *size) {
|
||||||
fclose(f);
|
*rom = (u8*)realloc(*rom, dataSize);
|
||||||
return false;
|
memset(*rom + *size, 0, dataSize - *size);
|
||||||
|
*size = dataSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
s64 relative = 0;
|
s64 relative = 0;
|
||||||
|
|
Loading…
Reference in New Issue