Fix T92934: crash rendering with wrong image path

These null checks were missing in rB0c3b215e7d5456878b155d13440864f49ad1f230.

Differential Revision: https://developer.blender.org/D13157
This commit is contained in:
Jacques Lucke
2021-11-09 13:30:15 +01:00
parent c56cf50bd0
commit 45bd98d4cf
2 changed files with 9 additions and 0 deletions

View File

@@ -1304,6 +1304,9 @@ void BKE_image_print_memlist(Main *bmain)
static bool imagecache_check_dirty(ImBuf *ibuf, void *UNUSED(userkey), void *UNUSED(userdata))
{
if (ibuf == NULL) {
return false;
}
return (ibuf->userflags & IB_BITMAPDIRTY) == 0;
}
@@ -1347,6 +1350,9 @@ void BKE_image_free_all_textures(Main *bmain)
static bool imagecache_check_free_anim(ImBuf *ibuf, void *UNUSED(userkey), void *userdata)
{
if (ibuf == NULL) {
return true;
}
int except_frame = *(int *)userdata;
return (ibuf->userflags & IB_BITMAPDIRTY) == 0 && (ibuf->index != IMA_NO_INDEX) &&
(except_frame != IMA_INDEX_ENTRY(ibuf->index));

View File

@@ -237,6 +237,9 @@ static int get_item_priority(void *item_v, int default_priority)
static bool get_item_destroyable(void *item_v)
{
MovieCacheItem *item = (MovieCacheItem *)item_v;
if (item->ibuf == NULL) {
return true;
}
/* IB_BITMAPDIRTY means image was modified from inside blender and
* changes are not saved to disk.
*