Fix glBindTexture crash (bug 14514)
authorBrian <brian.paul@tungstengraphics.com>
Fri, 15 Feb 2008 20:41:39 +0000 (13:41 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 15 Feb 2008 20:42:12 +0000 (13:42 -0700)
src/mesa/main/texobj.c

index 3e017c1eda1548d379c2bd44eea8dac9909d489d..24d8110b002ce638288c6fe88d194e9244125479 100644 (file)
@@ -861,7 +861,8 @@ _mesa_BindTexture( GLenum target, GLuint texName )
             newTexObj = ctx->Shared->Default2DArray;
             break;
          default:
-            ; /* Bad targets are caught above */
+            _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
+            return;
       }
    }
    else {
@@ -939,6 +940,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
          texUnit->Current2DArray = newTexObj;
          break;
       default:
+         /* Bad target should be caught above */
          _mesa_problem(ctx, "bad target in BindTexture");
          return;
    }