From cf67a55b36e4c2c2037827f70b374b6b537eeaca Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 25 Jun 2020 12:41:30 +0200 Subject: [PATCH] Fix transport reader --- .../main/java/net/osmand/binary/BinaryMapIndexReader.java | 6 ++++-- .../net/osmand/binary/BinaryMapTransportReaderAdapter.java | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index 0c496cfb00..86fce4f208 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -2660,8 +2660,10 @@ public class BinaryMapIndexReader { incompleteTransportRoutes = new TLongObjectHashMap<>(); for (TransportIndex ti : transportIndexes) { if (ti.incompleteRoutesLength > 0) { - transportAdapter.readIncompleteRoutesList(incompleteTransportRoutes, ti.incompleteRoutesLength, - ti.incompleteRoutesOffset); + codedIS.seek(ti.incompleteRoutesOffset); + int oldLimit = codedIS.pushLimit(ti.incompleteRoutesLength); + transportAdapter.readIncompleteRoutesList(incompleteTransportRoutes); + codedIS.popLimit(oldLimit); } } } diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 049fc161eb..358e908dbd 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -251,9 +251,7 @@ public class BinaryMapTransportReaderAdapter { return ((char) i)+""; } - public void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes, - int length, int offset) throws IOException { - codedIS.seek(offset); + public void readIncompleteRoutesList(TLongObjectHashMap incompleteRoutes) throws IOException { boolean end = false; while (!end) { int t = codedIS.readTag();