M values are optional for the PointZ shape type. If a PointZ shapefile did not contain M values, the old code would incorrectly fetch bytes from the next record and store it in the m field. For the last record, the code would crash since f.read(8) would return an empty string.
In order to fix this, this commit checks whether there are any bytes left (f.tell() < next1) when the shape type is PointZ (11).
M values are optional for the PointZ shape type. If a PointZ shapefile did not contain M values, the old code would incorrectly fetch bytes from the next record and store it in the
m
field. For the last record, the code would crash sincef.read(8)
would return an empty string.In order to fix this, this commit checks whether there are any bytes left (
f.tell() < next1
) when the shape type is PointZ (11
).