maplibre / maplibre-tile-spec

Next generation vector tiles format
Apache License 2.0
157 stars 13 forks source link

Error in geometry decoding: ArrayIndexOutOfBoundsException #183

Open springmeyer opened 3 months ago

springmeyer commented 3 months ago

In the non-advanced path, we hit this error with both the vectorized and non-vectorized decoders:

    java.lang.ArrayIndexOutOfBoundsException: Index -5 out of bounds for length 4
        at com.mlt.metadata.stream.StreamMetadata.decode(StreamMetadata.java:66)
        at com.mlt.metadata.stream.StreamMetadataDecoder.decode(StreamMetadataDecoder.java:8)
        at com.mlt.decoder.GeometryDecoder.decodeGeometryColumn(GeometryDecoder.java:28)
        at com.mlt.decoder.MltDecoder.decodeMlTile(MltDecoder.java:77)
        at com.mlt.decoder.MltDecoderTest.testTile(MltDecoderTest.java:200)
        at com.mlt.decoder.MltDecoderTest.decodeOMTTiles2(MltDecoderTest.java:146)

Currently seeing this with 3 OMT test fixtures:

› java -jar build/libs/encode.jar -mvt ../test/fixtures/omt/13_4265_5467.mvt -decode -vectorized
java.lang.ArrayIndexOutOfBoundsException: Index -5 out of bounds for length 4
    at com.mlt.metadata.stream.StreamMetadata.decode(StreamMetadata.java:66)
    at com.mlt.metadata.stream.StreamMetadataDecoder.decode(StreamMetadataDecoder.java:8)
    at com.mlt.decoder.vectorized.VectorizedGeometryDecoder.decodeToRandomAccessFormat(VectorizedGeometryDecoder.java:100)
    at com.mlt.decoder.MltDecoder.decodeMlTileVectorized(MltDecoder.java:161)
    at com.mlt.tools.Encode.main(Encode.java:254)
springmeyer commented 3 months ago

@mactrem of the errors I see in the new test coverage this feels like the most common and highest priority. Let me know if you either have an idea of what might be the problem or have time to take a look?