Fix out-of-bounds error when no threads were needed for a zoom level

This commit is contained in:
Eric Fischer 2018-01-18 12:10:47 -08:00
parent eb966ae398
commit e07a4dd51b
4 changed files with 18 additions and 1 deletions

View File

@ -43,7 +43,7 @@ matrix:
# debug+leak+address-sanitizer build
- os: linux
compiler: clang
env: CLANG_VERSION='3.8.0' BUILDTYPE=Debug ASAN_OPTIONS=detect_leaks=1 CC="clang-3.8" CXX="clang++-3.8" CXXFLAGS="-fsanitize=address" CFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address" FEWER=true
env: CLANG_VERSION='3.8.0' BUILDTYPE=Debug ASAN_OPTIONS=detect_leaks=1 CC="clang-3.8" CXX="clang++-3.8" CXXFLAGS="-fsanitize=address,undefined" CFLAGS="-fsanitize=address,undefined" LDFLAGS="-fsanitize=address,undefined" FEWER=true
addons:
apt:
sources: ['ubuntu-toolchain-r-test' ]

View File

@ -0,0 +1,13 @@
{ "type": "FeatureCollection", "properties": {
"bounds": "-180.000000,0.800000,180.000000,1.000000",
"center": "-179.989014,1.000000,14",
"description": "tests/onefeature/-zg_--drop-densest-as-needed.json.check.mbtiles",
"format": "pbf",
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 14, \"fields\": {} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"in\",\"count\": 1,\"geometry\": \"LineString\",\"attributeCount\": 0,\"attributes\": []}]}}",
"maxzoom": "14",
"minzoom": "0",
"name": "tests/onefeature/-zg_--drop-densest-as-needed.json.check.mbtiles",
"type": "overlay",
"version": "2"
}, "features": [
] }

1
tests/onefeature/in.json Normal file
View File

@ -0,0 +1 @@
{"":"","":[{"":"","":{"":[]},"":{"":""}},{"":"","type":"LineString","coordinates":[[1000,0.8],[900,1]]}

View File

@ -2363,6 +2363,9 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *metabase, char *stringpo
if (threads >= (1U << 30)) {
threads = 1U << 30;
}
if (threads < 1) {
threads = 1;
}
// Assign temporary files to threads