From 8bc91c760a04ddeee598101b821b21a3528e39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 8 Apr 2022 00:23:45 +0200 Subject: [PATCH] Only read the node offset when it is actually present --- src/map/IMG/nodfile.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map/IMG/nodfile.cpp b/src/map/IMG/nodfile.cpp index b590e584..8b675395 100644 --- a/src/map/IMG/nodfile.cpp +++ b/src/map/IMG/nodfile.cpp @@ -170,12 +170,12 @@ bool NODFile::linkInfo(Handle &hdl, const BlockInfo &blockInfo, quint32 linkId, if (!bs.read(s1 - s2, linkInfo.linkOffset)) return false; linkInfo.linkOffset += blockInfo.hdr.linkInfoOffsetBase; - } - if (!bs.read(s2, linkInfo.nodeOffset)) - return false; - linkInfo.nodeOffset = (blockInfo.offset - linkInfo.nodeOffset) - >> _nodeShift; + if (!bs.read(s2, linkInfo.nodeOffset)) + return false; + linkInfo.nodeOffset = (blockInfo.offset - linkInfo.nodeOffset) + >> _nodeShift; + } return true; }