Skip to content

Commit 779b0b6

Browse files
committed
Remove unnecessary seek
Fix file size test in verify_xiso() broken since 715d798
1 parent 1bc46b4 commit 779b0b6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

extract-xiso.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ int verify_xiso( int in_xiso, uint32_t *out_root_dir_sector, uint32_t *out_root_
971971
if ( ! err && memcmp( buffer, XISO_HEADER_DATA, XISO_HEADER_DATA_LENGTH ) ) misc_err( "%s appears to be corrupt", in_iso_name );
972972

973973
// seek to root directory sector
974-
if (!err && lseek_with_error(in_xiso, (xoff_t)*out_root_dir_sector * XISO_SECTOR_SIZE, SEEK_SET) == -1) seek_err();
974+
if (!err && lseek_with_error(in_xiso, (xoff_t)*out_root_dir_sector * XISO_SECTOR_SIZE + s_xbox_disc_lseek, SEEK_SET) == -1) seek_err();
975975

976976
return err;
977977
}
@@ -1201,8 +1201,6 @@ int decode_xiso( char *in_xiso, char *in_path, modes in_mode, char **out_iso_pat
12011201

12021202
root_dir_start = (xoff_t)root_dir_sect * XISO_SECTOR_SIZE + s_xbox_disc_lseek;
12031203
root_end_offset = (uint16_t)(n_sectors(root_dir_size) * XISO_SECTOR_SIZE / XISO_DWORD_SIZE);
1204-
1205-
if (!err && lseek_with_error(xiso, root_dir_start, SEEK_SET) == -1) seek_err();
12061204

12071205
if (in_mode == k_rewrite) {
12081206
if (!err && root_dir_size == 0) root = NULL;

0 commit comments

Comments
 (0)