diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index 632fd711c..450759d5d 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -3504,10 +3504,6 @@ int GL_LoadTextureFB (char *identifier, int width, int height, qbyte *data, qboo return glt->texnum; } - glt = BZ_Malloc(sizeof(*glt)+sizeof(bucket_t)); - glt->next = gltextures; - gltextures = glt; - for (i = 0; i < width*height; i++) if (data[i] > 255-vid.fullbright) break; @@ -3515,6 +3511,10 @@ int GL_LoadTextureFB (char *identifier, int width, int height, qbyte *data, qboo if (i == width*height) return 0; //none found, don't bother uploading. + glt = BZ_Malloc(sizeof(*glt)+sizeof(bucket_t)); + glt->next = gltextures; + gltextures = glt; + strcpy (glt->identifier, identifier); glt->texnum = texture_extension_number; glt->width = width;