diff options
author | Brian Paul <brianp@vmware.com> | 2009-10-01 19:01:02 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-10-01 19:01:02 -0600 |
commit | 8c92a531fb7e0d2de2a06610b2dff98eeb19c985 (patch) | |
tree | 4a6641092ee298b1cee8e7f398f62e8773b31d19 /src/mesa/main/texgetimage.c | |
parent | bb659f6e53095d4eeef85a3d586721306a0c3e80 (diff) |
mesa: reformatting
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r-- | src/mesa/main/texgetimage.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 3e3951b1c4..341ce6103f 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -322,10 +322,15 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, { GLuint size; + /* don't use texImage->CompressedSize since that may be padded out */ + size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, + texImage->Depth, + texImage->TexFormat); + if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > + if ((const GLubyte *) img + size > (const GLubyte *) ctx->Pack.BufferObj->Size) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImage(invalid PBO access)"); @@ -347,11 +352,6 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, return; } - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat); - /* just memcpy, no pixelstore or pixel transfer */ _mesa_memcpy(img, texImage->Data, size); |