Skip to content

Commit

Permalink
fix size estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacbrodsky committed Dec 4, 2023
1 parent da85fe5 commit b055cd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/apps/fuzzers/fuzzerPolygonToCellsExperimental.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ int populateGeoLoop(GeoLoop *g, const uint8_t *data, size_t *offset,

void run(GeoPolygon *geoPolygon, uint32_t flags, int res) {
int64_t sz;
H3Error err = H3_EXPORT(maxPolygonToCellsSize)(geoPolygon, res, flags, &sz);
H3Error err = H3_EXPORT(maxPolygonToCellsSizeExperimental)(geoPolygon, res,
flags, &sz);
if (!err && sz < MAX_SZ) {
H3Index *out = calloc(sz, sizeof(H3Index));
H3_EXPORT(polygonToCellsExperimental)(geoPolygon, res, flags, out);
Expand Down
3 changes: 2 additions & 1 deletion src/apps/fuzzers/fuzzerPolygonToCellsExperimentalNoHoles.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const int MAX_SZ = 4000000;

void run(GeoPolygon *geoPolygon, uint32_t flags, int res) {
int64_t sz;
H3Error err = H3_EXPORT(maxPolygonToCellsSize)(geoPolygon, res, flags, &sz);
H3Error err = H3_EXPORT(maxPolygonToCellsSizeExperimental)(geoPolygon, res,
flags, &sz);
if (!err && sz < MAX_SZ) {
H3Index *out = calloc(sz, sizeof(H3Index));
H3_EXPORT(polygonToCellsExperimental)(geoPolygon, res, flags, out);
Expand Down

0 comments on commit b055cd5

Please sign in to comment.