mirror of
https://github.com/gopher64/gopher64.git
synced 2026-10-31 03:26:52 +01:00
fix some memory offset checks (#1243)
This commit is contained in:
1 parent
9a46a22a05
commit
dd4df5fbca
5 files changed
+11
-7
No files matched your search
@@ -779,8 +779,12 @@ void rdp_save_state(uint8_t *state) {
|
||||
}
|
||||
}
|
||||
|
||||
void rdp_load_state(GFX_INFO _gfx_info, const uint8_t *state) {
|
||||
void rdp_load_state(GFX_INFO _gfx_info, const uint8_t *state,
|
||||
size_t state_size) {
|
||||
gfx_info = _gfx_info;
|
||||
if (state_size < rdp_state_size()) {
|
||||
return;
|
||||
}
|
||||
memcpy(&rdp_device, state, sizeof(RDP_DEVICE));
|
||||
|
||||
if (g_tmem) {
|
||||
@@ -852,7 +856,7 @@ uint64_t rdp_process_commands() {
|
||||
return interrupt_timer;
|
||||
} else {
|
||||
do {
|
||||
offset &= 0xFFFFF8;
|
||||
offset &= (gfx_info.RDRAM_SIZE - 1) & ~uint32_t(7);
|
||||
rdp_device.cmd_data[2 * rdp_device.cmd_ptr + 0] =
|
||||
*reinterpret_cast<const uint32_t *>(gfx_info.RDRAM + offset);
|
||||
rdp_device.cmd_data[2 * rdp_device.cmd_ptr + 1] =
|
||||
|
||||
Reference in new issue
Block a user