Bug #5754: Allocate texture memory correctly. (Richard Drummond)
This commit is contained in:
parent
a9cc078b0e
commit
76a0797c32
|
@ -1357,10 +1357,11 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level,
|
|||
1,
|
||||
internalFormat);
|
||||
dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width);
|
||||
texImage->Data = _mesa_malloc(texImage->CompressedSize);
|
||||
texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize);
|
||||
} else {
|
||||
dstRowStride = mml->width * texelBytes;
|
||||
texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes);
|
||||
texImage->Data = _mesa_alloc_texmemory(mml->width * mml->height *
|
||||
texelBytes);
|
||||
}
|
||||
if (!texImage->Data) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
|
||||
|
@ -1663,7 +1664,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target,
|
|||
mml->height,
|
||||
1,
|
||||
internalFormat);
|
||||
texImage->Data = _mesa_malloc(texImage->CompressedSize);
|
||||
texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize);
|
||||
if (!texImage->Data) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue