From 8b22a8f3395fd46cc056b7f7ed70fd5ab9e4a7ca Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 3 Feb 2025 20:29:06 -0600 Subject: [PATCH] [keel] Make buildUuidMap only read the first 40 bytes of each file --- src/olympic/keel/src/media.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/olympic/keel/src/media.cpp b/src/olympic/keel/src/media.cpp index 01e6f90d..c6982d21 100644 --- a/src/olympic/keel/src/media.cpp +++ b/src/olympic/keel/src/media.cpp @@ -53,10 +53,12 @@ static ox::Error buildUuidMap(Context &ctx, ox::StringViewCR path) noexcept { OX_REQUIRE_M(filePath, ox::join("/", ox::Array{path, f})); OX_REQUIRE(stat, ctx.rom->stat(filePath)); if (stat.fileType == ox::FileType::NormalFile) { - OX_REQUIRE(data, ctx.rom->read(filePath)); - auto const [hdr, err] = readAssetHeader(data); + ox::Array buff; + OX_RETURN_ERROR( + ctx.rom->read(filePath, 0, buff.size(), buff)); + auto const [uuid, err] = readUuidHeader(buff); if (!err) { - createUuidMapping(ctx, filePath, hdr.uuid); + createUuidMapping(ctx, filePath, uuid); } } else if (stat.fileType == ox::FileType::Directory) { if (!beginsWith(f, ".")) {