Skip to content
Snippets Groups Projects
Commit 7b5f2b71 authored by Yuichiro Hanada's avatar Yuichiro Hanada
Browse files

Fix Ver4DictDecoder.readAndFollowForwardLink().

Change-Id: Ib527a376b693be21aebd4920ac804ee9b161eb96
parent 008d84ff
No related branches found
No related tags found
No related merge requests found
...@@ -319,10 +319,13 @@ public class Ver4DictDecoder extends AbstractDictDecoder { ...@@ -319,10 +319,13 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
@Override @Override
public boolean readAndFollowForwardLink() { public boolean readAndFollowForwardLink() {
final int forwardLinkPos = mDictBuffer.position(); final int forwardLinkPos = mDictBuffer.position();
final int nextAddress = forwardLinkPos + BinaryDictDecoderUtils.readSInt24(mDictBuffer); int nextRelativePos = BinaryDictDecoderUtils.readSInt24(mDictBuffer);
if (nextAddress >= 0 && nextAddress < mDictBuffer.limit()) { if (nextRelativePos != FormatSpec.NO_FORWARD_LINK_ADDRESS) {
mDictBuffer.position(nextAddress); final int nextPos = forwardLinkPos + nextRelativePos;
return true; if (nextPos >= 0 && nextPos < mDictBuffer.limit()) {
mDictBuffer.position(nextPos);
return true;
}
} }
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment