diff --git a/tsk/fs/tsk_apfs.hpp b/tsk/fs/tsk_apfs.hpp
index 839ee00663ade8a2559ddf5ba063ece4cbf63566..27ec246bc9f5fa4ac1f86731a6c212072f9998fa 100755
--- a/tsk/fs/tsk_apfs.hpp
+++ b/tsk/fs/tsk_apfs.hpp
@@ -456,11 +456,11 @@ class APFSBtreeNode : public APFSObject, public APFSOmap::node_tag {
       throw std::runtime_error("APFSBtreeNode: invalid toffset");
     }
     _table_data.voff = _storage.data() + voffset();
-    if (_table_data.voff - _storage.data() > _storage.size()) {
+    if (_table_data.voff > _storage.data() + _storage.size()) {
       throw std::runtime_error("APFSBtreeNode: invalid voffset");
     }
     _table_data.koff = _storage.data() + koffset();
-    if (_table_data.koff - _storage.data() > _storage.size()) {
+    if (_table_data.koff > _storage.data() + _storage.size()) {
       throw std::runtime_error("APFSBtreeNode: invalid koffset");
     }
   }