From d67f119589191e8699db5fd0981d1b48580b1969 Mon Sep 17 00:00:00 2001 From: Steveice10 Date: Fri, 6 Jul 2018 14:16:15 -0700 Subject: [PATCH] am: Address review comments. --- src/core/file_sys/title_metadata.h | 4 ++-- src/core/hle/service/am/am.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/file_sys/title_metadata.h b/src/core/file_sys/title_metadata.h index d9d32a5fe..11a93349a 100644 --- a/src/core/file_sys/title_metadata.h +++ b/src/core/file_sys/title_metadata.h @@ -5,8 +5,8 @@ #pragma once #include -#include #include +#include #include #include "common/common_types.h" #include "common/swap.h" @@ -126,7 +126,7 @@ private: u32_be signature_type; std::vector tmd_signature; std::vector tmd_chunks; - std::map content_index_to_index; + std::unordered_map content_index_to_index; }; } // namespace FileSys diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 7f947dd59..f962bd7a4 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -399,8 +399,12 @@ std::string GetTitleContentPath(Service::FS::MediaType media_type, u64 tid, u16 u32 content_id = 0; FileSys::TitleMetadata tmd; if (tmd.Load(tmd_path) == Loader::ResultStatus::Success) { - if(contentIndex && tmd.ContentIndexExists(index)) { - index = tmd.ContentIndexToIndex(index); + if(contentIndex) { + if(tmd.ContentIndexExists(index)) { + index = tmd.ContentIndexToIndex(index); + } else { + LOG_ERROR(Service_AM, "Attempted to get path for non-existent content index {:04x}.", index); + } } content_id = tmd.GetContentIDByIndex(index); @@ -530,6 +534,8 @@ void Module::Interface::FindDLCContentInfos(Kernel::HLERequestContext& ctx) { u64 romfs_offset = 0; if (!tmd.ContentIndexExists(content_requested[i])) { + LOG_ERROR(Service_AM, "Attempted to get info for non-existent content index {:04x}.", content_requested[i]); + IPC::RequestBuilder rb = rp.MakeBuilder(1, 4); rb.Push(-1); // TODO: Find the right error code rb.PushMappedBuffer(content_requested_in);