]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
fixed cubemap upload scaling crash (was using power of 2 size for parsing input,...
[xonotic/darkplaces.git] / gl_textures.c
index f3e8a1b24725f79354ef47fbb8096cea351b55e4..cc43c8d37085be3dff3d14bf0f38d30b604f10dc 100644 (file)
@@ -786,7 +786,7 @@ static void R_Upload(gltexture_t *glt, qbyte *data)
                        for (i = 0;i < 6;i++)
                        {
                                prevbuffer = texturebuffer;
-                               texturebuffer += width * height * depth * glt->textype->inputbytesperpixel;
+                               texturebuffer += glt->width * glt->height * glt->depth * glt->textype->inputbytesperpixel;
                                if (glt->width != width || glt->height != height || glt->depth != depth)
                                {
                                        Image_Resample(prevbuffer, glt->width, glt->height, glt->depth, resizebuffer, width, height, depth, glt->image->bytesperpixel, r_lerpimages.integer);