1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-07-17 16:38:31 +00:00

fix the glitch that cut the end of the file if it's larger than the changed file patch was originally created with

This commit is contained in:
laqieer 2022-03-15 21:08:19 +08:00
parent 84298e9cee
commit 3dd109c6d9

View file

@ -57,6 +57,11 @@ UPS.prototype.apply=function(romFile, validate){
throw new Error('error_crc_input');
}
/* fix the glitch that cut the end of the file if it's larger than the changed file patch was originally created with */
sizeOutput = this.sizeOutput
if(!validate && sizeOutput < this.sizeInput){
sizeOutput = this.sizeInput
}
/* copy original file */
tempFile=new MarcFile(this.sizeOutput);
@ -201,4 +206,4 @@ function createUPSFromFiles(original, modified){
patch.checksumInput=crc32(original);
patch.checksumOutput=crc32(modified);
return patch
}
}