diff --git a/qbsp/surfaces.c b/qbsp/surfaces.c index 9e8db5b6..f16da620 100644 --- a/qbsp/surfaces.c +++ b/qbsp/surfaces.c @@ -488,6 +488,9 @@ MakeFaceEdges(mapentity_t *entity, node_t *headnode) edges->count = edges->index; } + if (map.cTotal[BSPVERTEX] > 65535) + Error("Too many vertices (%d > 65535)", map.cTotal[BSPVERTEX]); + surfedges->data = AllocMem(BSPSURFEDGE, surfedges->count, true); faces->data = AllocMem(BSPFACE, faces->count, true);