diff --git a/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java b/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java index d3ccda897b..dbacef62f1 100644 --- a/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java +++ b/DataExtractionOSM/src/net/osmand/binary/BinaryInspector.java @@ -49,7 +49,7 @@ public class BinaryInspector { // test cases show info -// inspector(new String[]{/*"-vmap", "-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/data/osm-gen/Map.obf"}); +// inspector(new String[]{/*"-vmap", "-bbox=-121.785,37.35,-121.744,37.33", */"/home/victor/projects/OsmAnd/data/osm-gen/Austria_2.obf"}); // test case extract parts // test case } diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index b38f9798fb..f679067a4c 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -61,6 +61,7 @@ Changes in 0.8.2 : \n\t* Improved Routing \n\t* Dynamic map widgets + \n\t* Lock screen button with logging services \n\t* Map settings moved to map screen Previous navigation was unfinished. Continue following it? (%1$s seconds) diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java index faed71ffa8..d2bac489a7 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsActivity.java @@ -125,7 +125,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference return getString(in); } } catch (Exception e) { - e.printStackTrace(); + System.err.println(e.getMessage()); } return defValue; } diff --git a/Osmand-kernel/osmand/src/binaryRead.cpp b/Osmand-kernel/osmand/src/binaryRead.cpp index cf856b75d8..4edbdf45f8 100644 --- a/Osmand-kernel/osmand/src/binaryRead.cpp +++ b/Osmand-kernel/osmand/src/binaryRead.cpp @@ -131,17 +131,17 @@ bool readMapLevel(CodedInputStream* input, MapRoot* root, bool initSubtrees) { break; } case OsmAndMapIndex_MapRootLevel::kBoxesFieldNumber: { + if (!initSubtrees) { + input->Skip(input->BytesUntilLimit()); + break; + } MapTreeBounds bounds; readInt(input, &bounds.length); bounds.filePointer = input->getTotalBytesRead(); - if(initSubtrees){ - int oldLimit = input->PushLimit(bounds.length); - readMapTreeBounds(input, &bounds, root); - root->bounds.push_back(bounds); - input->PopLimit(oldLimit); - } else { - input->Skip(input->BytesUntilLimit()); - } + int oldLimit = input->PushLimit(bounds.length); + readMapTreeBounds(input, &bounds, root); + root->bounds.push_back(bounds); + input->PopLimit(oldLimit); break; } @@ -911,9 +911,10 @@ ResultPublisher* searchObjectsForRendering(SearchQuery* q, bool skipDuplicates, FileInputStream input(file->fd); input.SetCloseOnDelete(false); CodedInputStream cis(&input); + cis.SetTotalBytesLimit(INT_MAX, INT_MAX >> 1); cis.Seek(mapIndex->filePointer); int oldLimit = cis.PushLimit(mapIndex->length); - readMapIndex(&cis, mapIndex, true); + readMapIndex(&cis, &(*mapIndex), true); cis.PopLimit(oldLimit); } // lazy initializing subtrees @@ -922,10 +923,10 @@ ResultPublisher* searchObjectsForRendering(SearchQuery* q, bool skipDuplicates, FileInputStream input(file->fd); input.SetCloseOnDelete(false); CodedInputStream cis(&input); + cis.SetTotalBytesLimit(INT_MAX, INT_MAX >> 1); cis.Seek(mapLevel->filePointer); - cis.SetTotalBytesLimit(INT_MAX, INT_MAX >> 2); int oldLimit = cis.PushLimit(mapLevel->length); - readMapLevel(&cis, mapLevel, true); + readMapLevel(&cis, &(*mapLevel), true); cis.PopLimit(oldLimit); } lseek(file->fd, 0, SEEK_SET);