[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52369] trunk/blender/source/blender/ blenkernel/intern/image.c: Fix #33234: Search string crashes Blender

Sergey Sharybin sergey.vfx at gmail.com
Mon Nov 19 18:31:34 CET 2012


Revision: 52369
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52369
Author:   nazgul
Date:     2012-11-19 17:31:31 +0000 (Mon, 19 Nov 2012)
Log Message:
-----------
Fix #33234: Search string crashes Blender

Own regression since image threading safe commit.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/image.c

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2012-11-19 17:22:40 UTC (rev 52368)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2012-11-19 17:31:31 UTC (rev 52369)
@@ -2920,8 +2920,21 @@
 /* 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);
 




More information about the Bf-blender-cvs mailing list