diff --git a/js/formats/ups.js b/js/formats/ups.js index 39eecc4..07a81f1 100644 --- a/js/formats/ups.js +++ b/js/formats/ups.js @@ -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 -} \ No newline at end of file +}