Index: fnc_layer_setup.c =================================================================== --- fnc_layer_setup.c (revision 33081) +++ fnc_layer_setup.c (revision 33082) @@ -307,14 +307,20 @@ rnd_trace(" sub! %p %$mm\n", iceberg, (rnd_coord_t)sqrt(iceberg->contours->area)); rnd_polyarea_boolean_free(iceberg, heat, &ptmp, RND_PBO_SUB); iceberg = ptmp; + if (iceberg == NULL) + break; } } - res = sqrt(iceberg->contours->area); + if (iceberg != NULL) { + res = sqrt(iceberg->contours->area); + rnd_polyarea_free(&iceberg); + } + else + res = 0; + rnd_trace(" res=%$mm\n", (rnd_coord_t)res); - rnd_polyarea_free(&iceberg); - /* by now iceberg contains 'exposed' parts, anything not covered by objects found; if it is not zero, the cover was not full */ return res;