mirror of
https://github.com/86Box/bios-tools.git
synced 2026-02-25 04:45:32 -07:00
bios_extract: Fix AFUDOS extraction segfault
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user