mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Memory safety fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user