diff --git a/wfc.h b/wfc.h index 0ed5e5f..a1679db 100644 --- a/wfc.h +++ b/wfc.h @@ -1314,6 +1314,9 @@ static struct wfc__tile *wfc__create_tiles_overlapping(struct wfc_image *image, int xcnt = image->width - tile_width + 1; int ycnt = image->height - tile_height + 1; + struct wfc__tile *tiles = NULL; + int base_tile_cnt = 0; + if (expand_image) { xcnt = image->width; ycnt = image->height; @@ -1331,7 +1334,7 @@ static struct wfc__tile *wfc__create_tiles_overlapping(struct wfc_image *image, if (rotate_tiles) *tile_cnt *= 4; - struct wfc__tile *tiles = wfc__create_tiles(*tile_cnt); + tiles = wfc__create_tiles(*tile_cnt); if (tiles == NULL) goto CLEANUP; @@ -1339,7 +1342,7 @@ static struct wfc__tile *wfc__create_tiles_overlapping(struct wfc_image *image, if (!wfc__add_overlapping_images(tiles, image, xcnt, ycnt, tile_width, tile_height)) goto CLEANUP; - int base_tile_cnt = xcnt * ycnt; + base_tile_cnt = xcnt * ycnt; if (xflip_tiles) { if (!wfc__add_flipped_images(tiles, base_tile_cnt, 0)) goto CLEANUP;