Fixed the first batch of problems.

This commit is contained in:
OBattler
2020-01-15 03:04:59 +01:00
parent 714d77dedd
commit 8749776144
10 changed files with 62 additions and 26 deletions

View File

@@ -166,7 +166,10 @@ image_is_vhd(const wchar_t *s, int check_signature)
return 0;
fseeko64(f, 0, SEEK_END);
filelen = ftello64(f);
fseeko64(f, -512, SEEK_END);
if (fseeko64(f, -512, SEEK_END) == -1) {
fclose(f);
fatal("image_is_vhd(): Error seeking\n");
}
if (filelen < 512) {
if (f != NULL)
fclose(f);