diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index a57c1e67c..d378da2d4 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -592,9 +592,10 @@ void Module::Interface::ListDLCContentInfos(Kernel::HLERequestContext& ctx) { u32 copied = 0; FileSys::TitleMetadata tmd; if (tmd.Load(tmd_path) == Loader::ResultStatus::Success) { - copied = std::min(content_count, static_cast(tmd.GetContentCount())); + u32 end_index = + std::min(start_index + content_count, static_cast(tmd.GetContentCount())); std::size_t write_offset = 0; - for (u32 i = start_index; i < start_index + copied; i++) { + for (u32 i = start_index; i < end_index; i++) { std::shared_ptr romfs_file; u64 romfs_offset = 0; @@ -612,6 +613,7 @@ void Module::Interface::ListDLCContentInfos(Kernel::HLERequestContext& ctx) { content_info_out.Write(&content_info, write_offset, sizeof(ContentInfo)); write_offset += sizeof(ContentInfo); + copied++; } }