mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Merge pull request #5790 from sum2012/scedmac
Further illegal size check in sceDmacMemcpy
This commit is contained in:
commit
19000c7a37
@ -16,6 +16,7 @@
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/HLE/sceDmac.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Reporting.h"
|
||||
@ -75,9 +76,9 @@ u32 sceDmacMemcpy(u32 dst, u32 src, u32 size) {
|
||||
ERROR_LOG(HLE, "sceDmacMemcpy(dest=%08x, src=%08x, size=%i): invalid address", dst, src, size);
|
||||
return SCE_KERNEL_ERROR_INVALID_POINTER;
|
||||
}
|
||||
if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size == 0xFFFFFFFF) {
|
||||
if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size >= 0x80000000) {
|
||||
ERROR_LOG(HLE, "sceDmacMemcpy(dest=%08x, src=%08x, size=%i): illegal size", dst, src, size);
|
||||
return 0x80000023;
|
||||
return SCE_ERROR_PRIV_REQUIRED;
|
||||
}
|
||||
|
||||
if (dmacMemcpyDeadline > CoreTiming::GetTicks()) {
|
||||
@ -100,9 +101,9 @@ u32 sceDmacTryMemcpy(u32 dst, u32 src, u32 size) {
|
||||
ERROR_LOG(HLE, "sceDmacTryMemcpy(dest=%08x, src=%08x, size=%i): invalid address", dst, src, size);
|
||||
return SCE_KERNEL_ERROR_INVALID_POINTER;
|
||||
}
|
||||
if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size == 0xFFFFFFFF) {
|
||||
if (dst + size >= 0x80000000 || src + size >= 0x80000000 || size >= 0x80000000) {
|
||||
ERROR_LOG(HLE, "sceDmacTryMemcpy(dest=%08x, src=%08x, size=%i): illegal size", dst, src, size);
|
||||
return 0x80000023;
|
||||
return SCE_ERROR_PRIV_REQUIRED;
|
||||
}
|
||||
|
||||
if (dmacMemcpyDeadline > CoreTiming::GetTicks()) {
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
class PointerWrap;
|
||||
|
||||
enum {
|
||||
SCE_ERROR_PRIV_REQUIRED = 0x80000023,
|
||||
};
|
||||
|
||||
void __DmacInit();
|
||||
void __DmacDoState(PointerWrap &p);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user