Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-01-14 13:23:12 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-01-20 23:21:59 +0300
commitaee2b754dc8f5c4ddaf840cd83f979dd22fe4dc3 (patch)
tree9d6f8a263fbb1a99fac70a8e1f3619b101942c4a /source/blender/blenkernel
parentddddb94517bc4315afe53665c870adc5192c1474 (diff)
Fix T73110: UDIM Texture Paint Crash
This would happen if a tile is found on disk, painting would actually request that tile (because corresponding uvs were in that range), but that tile was not added in blenders list of tiles in that Image. Need to also check tile in `image_quick_test` (regardless of iuser having passed). thx @lukasstockner97 for additional input! Maniphest Tasks: T73110 Differential Revision: https://developer.blender.org/D6578
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/image.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index f748ad64bc4..fe1f9097562 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -3891,7 +3891,12 @@ static void image_initialize_after_load(Image *ima, ImageUser *iuser, ImBuf *UNU
BKE_image_tag_time(ima);
ImageTile *tile = BKE_image_get_tile_from_iuser(ima, iuser);
- tile->ok = IMA_OK_LOADED;
+ /* Images should never get loaded if the corresponding tile does not exist,
+ * but we should at least not crash if it happens due to a bug elsewhere. */
+ BLI_assert(tile != NULL);
+ if (tile != NULL) {
+ tile->ok = IMA_OK_LOADED;
+ }
}
static int imbuf_alpha_flags_for_image(Image *ima)
@@ -4764,14 +4769,14 @@ BLI_INLINE bool image_quick_test(Image *ima, ImageUser *iuser)
return false;
}
- ImageTile *tile = BKE_image_get_tile_from_iuser(ima, iuser);
-
if (iuser) {
if (iuser->ok == 0) {
return false;
}
}
- else if (tile == NULL) {
+
+ ImageTile *tile = BKE_image_get_tile_from_iuser(ima, iuser);
+ if (tile == NULL) {
return false;
}
else if (tile->ok == 0) {