bios_extract: Fix AFUDOS extraction segfault

This commit is contained in:
RichardG867
2022-05-01 18:51:52 -03:00
parent e32d8cd3cf
commit 3afd678484
2 changed files with 3 additions and 3 deletions

View File

@@ -640,10 +640,11 @@ AFUDOSExtract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset,
SetRemainder(((unsigned char *)hdr) - BIOSImage, hdr->ROMSize, FALSE);
SaveRemainder(BIOSImage);
free(remainder_buf);
remainder_buf = NULL;
rename("remainder.rom", "afudos_remainder.rom");
}
char *argv[] = {"\x01", "afudos.bin"};
char *argv[] = {"", "afudos.bin"};
int ret = main(2, argv);
unlink("afudos.bin");

View File

@@ -269,8 +269,7 @@ int main(int argc, char *argv[])
Offset2 = Offset1;
}
if ((argv[0][0] != 0x01) || (argv[0][1] != 0x00))
InitRemainder(BIOSImage, FileLength);
InitRemainder(BIOSImage, FileLength);
len = BIOSIdentification[i].Handler
(BIOSImage, FileLength, BIOSOffset, Offset1, Offset2);