diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index 58bbb90d40..4194c0cbd5 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -319,7 +319,7 @@ void UpdateVRInput(bool haptics, float dp_xscale, float dp_yscale) { VR_SetConfig(VR_CONFIG_CANVAS_6DOF, g_Config.bEnable6DoF); //inform engine about the status - TouchInput touch; + TouchInput touch{}; touch.id = mouseController; touch.x = x * dp_xscale; touch.y = (height - y - 1) * dp_yscale; diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 733a6af1f9..93ec8969b0 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -530,7 +530,7 @@ bool NPDRMDemoBlockDevice::ReadBlock(int blockNumber, u8 *outPtr, bool uncached) if (table_[block].size < blockSize_) { int lzsize = lzrc_decompress(blockBuf_, 0x00100000, readBuf, table_[block].size); - if(lzsize!=blockSize_){ + if(lzsize != blockSize_){ ERROR_LOG(Log::Loader, "LZRC decompress error! lzsize=%d\n", lzsize); NotifyReadError(); return false; diff --git a/Core/FileSystems/tlzrc.cpp b/Core/FileSystems/tlzrc.cpp index 414fec0032..82749c8fce 100644 --- a/Core/FileSystems/tlzrc.cpp +++ b/Core/FileSystems/tlzrc.cpp @@ -215,14 +215,17 @@ int lzrc_decompress(void *out, int out_len, void *in, int in_len) if(rc.lc&0x80){ /* plain text */ - memcpy(rc.output, rc.input+5, rc.code); - return rc.code; + int copySize = rc.code; + if (copySize > out_len) { + copySize = out_len; + } + memcpy(rc.output, rc.input+5, copySize); + return copySize; } rc_state = 0; last_byte = 0; - while (1) { round += 1; match_step = 0;