changeset 29896:ac3e6e27f2c7

Use calloc to allocate a rather large (currently 32k) array instead of putting it on the stack, performance should not matter much here.
author reimar
date Fri, 20 Nov 2009 23:36:16 +0000
parents 3ea2508a43ce
children f1bf918917c6
files libvo/gl_common.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Fri Nov 20 10:32:45 2009 +0000
+++ b/libvo/gl_common.c	Fri Nov 20 23:36:16 2009 +0000
@@ -695,7 +695,7 @@
  * \param unit texture unit to attach texture to
  */
 static void gen_spline_lookup_tex(GLenum unit) {
-  GLfloat tex[4 * LOOKUP_BSPLINE_RES];
+  GLfloat *tex = calloc(4 * LOOKUP_BSPLINE_RES, sizeof(*tex));
   GLfloat *tp = tex;
   int i;
   for (i = 0; i < LOOKUP_BSPLINE_RES; i++) {
@@ -712,6 +712,7 @@
   glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
   glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
   ActiveTexture(GL_TEXTURE0);
+  free(tex);
 }
 
 static const char *bilin_filt_template =