From 2c3d1d9e60c25382c2b995791d8e65192b6aca3c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 2 Nov 2024 22:25:39 +1000 Subject: [PATCH] dep/libchdr: Check that metadata seek succeeds --- dep/libchdr/src/libchdr_chd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dep/libchdr/src/libchdr_chd.c b/dep/libchdr/src/libchdr_chd.c index d5dd19a91..6ee62ce3a 100644 --- a/dep/libchdr/src/libchdr_chd.c +++ b/dep/libchdr/src/libchdr_chd.c @@ -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;