From 373227e42265650b30e1f6a7b3d73aa6bfa84219 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Wed, 1 Feb 2023 13:58:12 -0800 Subject: [PATCH] Fix seeking within compressed feature streams --- tile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tile.cpp b/tile.cpp index 34bbbc03..358561ef 100644 --- a/tile.cpp +++ b/tile.cpp @@ -2264,7 +2264,10 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch if (compressed_input) { long long n = *geompos_in; printf("-------- seek: end %lld to %lld\n", n, og); - geoms->end(geompos_in); + if (geoms->within) { + geoms->end(geompos_in); + } + geoms->begin(); } @@ -2273,6 +2276,8 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch exit(EXIT_SEEK); } *geompos_in = og; + geoms->zs.avail_in = 0; + geoms->zs.avail_out = 0; } int prefilter_write = -1, prefilter_read = -1;