Skip to content

Commit

Permalink
Merge pull request #6522 from szekerest/6521_fix
Browse files Browse the repository at this point in the history
Handle null shapes in msShapefileWhichShapes (#6521)
  • Loading branch information
jmckenna committed May 2, 2022
2 parents 8af8251 + 0fa98bf commit e285ae1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mapshape.c
Expand Up @@ -1891,8 +1891,12 @@ int msShapefileWhichShapes(shapefileObj *shpfile, rectObj rect, int debug)
}

for(i=0; i<shpfile->numshapes; i++) {
if(msSHPReadBounds(shpfile->hSHP, i, &shaperect) != MS_SUCCESS)
if(msSHPReadBounds(shpfile->hSHP, i, &shaperect) != MS_SUCCESS) {
if (msSHXReadSize(shpfile->hSHP, i) == 4) { /* handle NULL shape */
continue;
}
return(MS_FAILURE);
}

if(msRectOverlap(&shaperect, &rect) == MS_TRUE) msSetBit(shpfile->status, i, 1);
}
Expand Down

0 comments on commit e285ae1

Please sign in to comment.