Mesa (master): mesa: move _mesa_error() call in compressedteximage()

Brian Paul brianp at kemper.freedesktop.org
Fri Dec 2 06:52:47 PST 2011


Module: Mesa
Branch: master
Commit: 89efc1b839591473d0a448dc1087a5deb56579c7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=89efc1b839591473d0a448dc1087a5deb56579c7

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Dec  1 16:37:49 2011 -0700

mesa: move _mesa_error() call in compressedteximage()

We shouldn't call _mesa_error() if the target is a proxy texture.
Errors are handled later in the function.
Fixes a Coverity warning.

Reviewed-by: José Fonseca <jfonseca at vmware.com>

---

 src/mesa/main/teximage.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 2bdcedc..99905de 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3361,14 +3361,9 @@ compressedteximage(struct gl_context *ctx, GLuint dims,
                                           internalFormat, width, height, depth,
                                           border, imageSize, &reason);
 
-   if (error) {
-      _mesa_error(ctx, error, "glCompressedTexImage%uD(%s)", dims, reason);
-      return;
-   }
-
 #if FEATURE_ES
    /* XXX this is kind of a hack */
-   if (dims == 2) {
+   if (!error && dims == 2) {
       switch (internalFormat) {
       case GL_PALETTE4_RGB8_OES:
       case GL_PALETTE4_RGBA8_OES:
@@ -3422,7 +3417,7 @@ compressedteximage(struct gl_context *ctx, GLuint dims,
       struct gl_texture_image *texImage;
 
       if (error) {
-         _mesa_error(ctx, error, "glCompressedTexImage%uD", dims);
+         _mesa_error(ctx, error, "glCompressedTexImage%uD(%s)", dims, reason);
          return;
       }
 



More information about the mesa-commit mailing list