summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2015-04-16 15:27:41 -0600
committerBrian Paul <[email protected]>2015-04-22 08:58:05 -0600
commitbd4dbdfa519362f74263a2c277a3b4be841acd06 (patch)
treea459a4c1d7d780828c7bd41525275a7329156454 /src
parentb260d9d91f84f26676cf8baf42c6df88678be668 (diff)
mesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV()
If an app called glTextureBarrierNV() without checking if the extension was available, we'd crash with some gallium drivers in st_TextureBarrier() because the pipe_context::texture_barrier() pointer was NULL. Generate GL_INVALID_OPERATION instead. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texturebarrier.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/texturebarrier.c b/src/mesa/main/texturebarrier.c
index 08ff561504c..d879eed57f2 100644
--- a/src/mesa/main/texturebarrier.c
+++ b/src/mesa/main/texturebarrier.c
@@ -49,5 +49,11 @@ _mesa_TextureBarrierNV(void)
{
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.NV_texture_barrier) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTextureBarrier(not supported)");
+ return;
+ }
+
ctx->Driver.TextureBarrier(ctx);
}