[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56960] trunk/blender/source/blender/ render/intern/source/imagetexture.c: Fix #35458: SIGSEGV ( crash ) in imagewraposa()

Sergey Sharybin sergey.vfx at gmail.com
Wed May 22 08:22:28 CEST 2013


Revision: 56960
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56960
Author:   nazgul
Date:     2013-05-22 06:22:28 +0000 (Wed, 22 May 2013)
Log Message:
-----------
Fix #35458: SIGSEGV ( crash ) in imagewraposa()

Was missing a NULL-check.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/imagetexture.c

Modified: trunk/blender/source/blender/render/intern/source/imagetexture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/imagetexture.c	2013-05-22 06:06:22 UTC (rev 56959)
+++ trunk/blender/source/blender/render/intern/source/imagetexture.c	2013-05-22 06:22:28 UTC (rev 56960)
@@ -224,9 +224,11 @@
 	}
 
 	/* keep this before interpolation [#29761] */
-	if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
-		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-			texres->talpha = TRUE;
+	if (ima) {
+		if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
+			if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+				texres->talpha = TRUE;
+			}
 		}
 	}
 
@@ -1529,9 +1531,11 @@
 	/* mipmap test */
 	image_mipmap_test(tex, ibuf);
 
-	if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
-		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-			texres->talpha = TRUE;
+	if (ima) {
+		if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
+			if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+				texres->talpha = TRUE;
+			}
 		}
 	}
 	




More information about the Bf-blender-cvs mailing list