diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-19 21:31:31 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-19 21:31:31 +0400 |
commit | 74a6ee44f0fd9211e9c76f6723d0b2ae2ae28459 (patch) | |
tree | 2368588fdbe07493a373a2a0cf968b33efcc26a6 /source/blender/blenkernel/intern/image.c | |
parent | d0a72598373d23e8c6def4158d29c96ac73411ed (diff) |
Fix #33234: Search string crashes Blender
Own regression since image threading safe commit.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d98c2bc2f8b..e4b9edacc7e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2920,7 +2920,20 @@ void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock) /* checks whether there's an image buffer for given image and user */ int BKE_image_has_ibuf(Image *ima, ImageUser *iuser) { - ImBuf *ibuf = image_get_ibuf_threadsafe(ima, iuser, NULL, NULL); + ImBuf *ibuf; + + /* quick reject tests */ + if (ima == NULL) + return FALSE; + + if (iuser) { + if (iuser->ok == 0) + return FALSE; + } + else if (ima->ok == 0) + return FALSE; + + ibuf = image_get_ibuf_threadsafe(ima, iuser, NULL, NULL); if (!ibuf) { BLI_spin_lock(&image_spin); |