From d0b54e993960aa392038ff971a6aaecc7188aebf Mon Sep 17 00:00:00 2001 From: Zak Kurka Date: Sat, 20 Oct 2018 23:25:16 -0500 Subject: [PATCH] Check for EOF --- src/core/file_sys/ncch_container.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/file_sys/ncch_container.cpp b/src/core/file_sys/ncch_container.cpp index 34f98e9fe..bdcf5837e 100644 --- a/src/core/file_sys/ncch_container.cpp +++ b/src/core/file_sys/ncch_container.cpp @@ -543,6 +543,11 @@ void NCCHContainer::ApplyIPS(std::vector& ips, std::vector& buffer) { return; while (cursor < patch_length) { + std::string eof_check(ips.begin() + cursor, ips.begin() + cursor + 3); + + if (eof_check == "EOF") + return; + u32 offset = ips[cursor] << 16 | ips[cursor + 1] << 8 | ips[cursor + 2]; std::size_t length = ips[cursor + 3] << 8 | ips[cursor + 4];