From 9a87ece8376530b85df5e21daac317dd2393097c Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 25 Oct 2018 14:23:56 -0400 Subject: ips_layer: Use rle_size instead of data_size in RLE patch application Prevents a potential bug when using RLE records in an IPS patch. --- src/core/file_sys/ips_layer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 554eae9bc..999939d5a 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -99,7 +99,7 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { u16 rle_size{}; if (ips->ReadObject(&rle_size, offset) != sizeof(u16)) return nullptr; - rle_size = Common::swap16(data_size); + rle_size = Common::swap16(rle_size); offset += sizeof(u16); const auto data = ips->ReadByte(offset++); -- cgit v1.2.3