Added a sanity check to the FDI2RAW code.

This commit is contained in:
OBattler
2020-01-14 20:53:39 +01:00
parent 989ee3b138
commit f2beb0bc56

View File

@@ -2029,6 +2029,10 @@ FDI *fdi2raw_header(FILE *f)
memset (fdi, 0, sizeof (FDI));
fdi->file = f;
oldseek = ftell (fdi->file);
if (oldseek == -1) {
fdi_free(fdi);
return NULL;
}
fseek (fdi->file, 0, SEEK_SET);
fread (fdi->header, 2048, 1, fdi->file);
fseek (fdi->file, oldseek, SEEK_SET);