[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14998] branches/apricot/source/blender/ gpu/intern/gpu_extensions.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Tue May 27 12:17:25 CEST 2008


Revision: 14998
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14998
Author:   blendix
Date:     2008-05-27 12:17:25 +0200 (Tue, 27 May 2008)

Log Message:
-----------

Fix for #12633: crash with scaling of non power of two textures in
the apricot glsl code.

Modified Paths:
--------------
    branches/apricot/source/blender/gpu/intern/gpu_extensions.c

Modified: branches/apricot/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/apricot/source/blender/gpu/intern/gpu_extensions.c	2008-05-27 09:46:35 UTC (rev 14997)
+++ branches/apricot/source/blender/gpu/intern/gpu_extensions.c	2008-05-27 10:17:25 UTC (rev 14998)
@@ -385,7 +385,7 @@
 		x= smaller_pow2_limit(x);
 		y= smaller_pow2_limit(y);
 		
-		scalerect= MEM_mallocN(x*y*sizeof(*scalerect), "scalerect");
+		scalerect= MEM_mallocN(x*y*sizeof(*scalerect)*4, "scalerect");
 		gluScaleImage(GL_RGBA, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, rect, x, y, GL_UNSIGNED_BYTE, scalerect);
 		rect= scalerect;
 	}
@@ -940,6 +940,9 @@
 {
 	GLint location = glGetUniformLocationARB(shader->object, name);
 
+	if(location == -1)
+		return;
+
 	GPU_print_error("Pre Uniform Vector");
 
 	if (length == 1) glUniform1fvARB(location, arraysize, value);





More information about the Bf-blender-cvs mailing list