}
else if (srcFormat == GL_DEPTH_COMPONENT ||
srcFormat == GL_STENCIL_INDEX) {
+ GLuint *depth = (GLuint *) malloc(srcWidth * sizeof(GLuint));
+ GLubyte *stencil = (GLubyte *) malloc(srcWidth * sizeof(GLubyte));
+
+ if (!depth || !stencil) {
+ free(depth);
+ free(stencil);
+ return GL_FALSE;
+ }
+
/* In case we only upload depth we need to preserve the stencil */
for (img = 0; img < srcDepth; img++) {
GLuint *dstRow = (GLuint *) dstSlices[img];
srcFormat, srcType,
img, 0, 0);
for (row = 0; row < srcHeight; row++) {
- GLuint depth[MAX_WIDTH];
- GLubyte stencil[MAX_WIDTH];
GLint i;
GLboolean keepdepth = GL_FALSE, keepstencil = GL_FALSE;
dstRow += dstRowStride / sizeof(GLuint);
}
}
+
+ free(depth);
+ free(stencil);
}
return GL_TRUE;
}
const GLint srcRowStride
= _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLint img, row;
+ GLuint *depth;
+ GLubyte *stencil;
ASSERT(dstFormat == MESA_FORMAT_S8_Z24);
ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT ||
ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT ||
srcType == GL_UNSIGNED_INT_24_8_EXT);
+ depth = (GLuint *) malloc(srcWidth * sizeof(GLuint));
+ stencil = (GLubyte *) malloc(srcWidth * sizeof(GLubyte));
+
+ if (!depth || !stencil) {
+ free(depth);
+ free(stencil);
+ return GL_FALSE;
+ }
+
for (img = 0; img < srcDepth; img++) {
GLuint *dstRow = (GLuint *) dstSlices[img];
const GLubyte *src
srcFormat, srcType,
img, 0, 0);
for (row = 0; row < srcHeight; row++) {
- GLuint depth[MAX_WIDTH];
- GLubyte stencil[MAX_WIDTH];
GLint i;
GLboolean keepdepth = GL_FALSE, keepstencil = GL_FALSE;
dstRow += dstRowStride / sizeof(GLuint);
}
}
+
+ free(depth);
+ free(stencil);
+
return GL_TRUE;
}
const GLint srcRowStride
= _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
GLint img, row;
-
+ GLubyte *stencil = (GLubyte *) malloc(srcWidth * sizeof(GLubyte));
+
+ if (!stencil)
+ return GL_FALSE;
+
for (img = 0; img < srcDepth; img++) {
GLubyte *dstRow = dstSlices[img];
const GLubyte *src
srcFormat, srcType,
img, 0, 0);
for (row = 0; row < srcHeight; row++) {
- GLubyte stencil[MAX_WIDTH];
GLint i;
/* get the 8-bit stencil values */
}
}
+ free(stencil);
}
return GL_TRUE;