Skip to content

Commit

Permalink
Fix shapefile driver crash in msSHPLayerNextShape (#6524)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest authored and github-actions[bot] committed May 5, 2022
1 parent edb261e commit 6ceabc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mapshape.c
Original file line number Diff line number Diff line change
Expand Up @@ -2787,6 +2787,11 @@ int msSHPLayerNextShape(layerObj *layer, shapeObj *shape)
return MS_FAILURE;
}

if (!shpfile->status) {
/* probably whichShapes didn't overlap */
return MS_DONE;
}

i = msGetNextBit(shpfile->status, shpfile->lastshape + 1, shpfile->numshapes);
shpfile->lastshape = i;
if(i == -1) return(MS_DONE); /* nothing else to read */
Expand Down

0 comments on commit 6ceabc2

Please sign in to comment.