From e549dafdc7b22a0d96bd044c5d54515d9420bb48 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sun, 14 Oct 2018 23:42:40 +0200 Subject: [PATCH] DroidFish: Fix crash when probing "wide" DTZ tables. --- DroidFish/jni/rtb/rtb-core-impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DroidFish/jni/rtb/rtb-core-impl.hpp b/DroidFish/jni/rtb/rtb-core-impl.hpp index 07ff541..bcc25ec 100644 --- a/DroidFish/jni/rtb/rtb-core-impl.hpp +++ b/DroidFish/jni/rtb/rtb-core-impl.hpp @@ -1207,7 +1207,7 @@ static int init_table_dtz(struct TBEntry *entry) data += ((uintptr_t)data) & 0x01; for (int i = 0; i < 4; i++) { ptr->map_idx[i] = (uint16_t)((uint16_t*)data - (uint16_t*)ptr->map + 1); - data += 2 + ((uint16_t*)data)[0]; + data += 2 + ((uint16_t*)data)[0] * 2; } } else { for (int i = 0; i < 4; i++) { @@ -1248,7 +1248,7 @@ static int init_table_dtz(struct TBEntry *entry) data += ((uintptr_t)data) & 0x01; for (int i = 0; i < 4; i++) { ptr->map_idx[f][i] = (uint16_t)((uint16_t*)data - (uint16_t*)ptr->map + 1); - data += 2 + ((uint16_t*)data)[0]; + data += 2 + ((uint16_t*)data)[0] * 2; } } else { for (int i = 0; i < 4; i++) {