Fix T73898: UDIM crash changing form tiled to single

This commit is contained in:
Campbell Barton 2020-02-17 12:33:12 +11:00 committed by Nathan Letwory
parent 596c96c5e6
commit 332b7d7d94
No known key found for this signature in database
GPG Key ID: 2C99F9D5FC4EFA4C
Notes: blender-bot 2023-02-14 03:13:26 +01:00
Referenced by issue #73898, 2.82 crash when changing image from tiled to single
1 changed files with 3 additions and 1 deletions

View File

@ -3363,7 +3363,9 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
if (ima->source != IMA_SRC_TILED) {
/* Free all but the first tile. */
ImageTile *base_tile = BKE_image_get_tile(ima, 0);
for (ImageTile *tile = base_tile->next; tile; tile = tile->next) {
BLI_assert(base_tile == ima->tiles.first);
for (ImageTile *tile = base_tile->next, *tile_next; tile; tile = tile_next) {
tile_next = tile->next;
image_free_tile(ima, tile);
MEM_freeN(tile);
}