dep/libchdr: Check that metadata seek succeeds

This commit is contained in:
Stenzek 2024-11-02 22:25:39 +10:00
parent 12acecbf36
commit 2c3d1d9e60
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -3201,7 +3201,8 @@ static chd_error metadata_find_entry(chd_file *chd, uint32_t metatag, uint32_t m
uint32_t count;
/* read the raw header */
core_fseek(chd->file, metaentry->offset, SEEK_SET);
if (core_fseek(chd->file, metaentry->offset, SEEK_SET) != 0)
break;
count = core_fread(chd->file, raw_meta_header, sizeof(raw_meta_header));
if (count != sizeof(raw_meta_header))
break;