aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/get.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-11 09:17:45 +0100
committermarha <marha@users.sourceforge.net>2013-04-11 11:13:33 +0200
commita2ce004b2966da2fe0249e72e2fb99255cef3092 (patch)
treec129fd586c3be01193bd767fb9f6db5d49ed1bfe /mesalib/src/mesa/main/get.c
parentfb84fb26466262dcab4bd31bdf51c982f14f891a (diff)
downloadvcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.tar.gz
vcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.tar.bz2
vcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.zip
fontconfig libX11 mesa pixman xserver xkeyboard-config git update 11 Mar
2013 xserver commit 5047810a4c20fab444b8c6eb146c55dcdb0d4219 xkeyboard-config commit 2ed85c1e936f7cd4a9540ace5c12b9fec60ee1fb libX11 commit 3996543c1b2919e97d61a5d70fe1ebd7cd76fc83 pixman commit aaae3d8eefa069098e9014822817ca1429fdea46 fontconfig commit bdf1581e3de5528f397f19bfd4ca9caaf9e7fe4a mesa commit b21a9d46e4be0c666327569f07b9cddeb4d42d38
Diffstat (limited to 'mesalib/src/mesa/main/get.c')
-rw-r--r--mesalib/src/mesa/main/get.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 2399f9c9d..582ef3198 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -34,6 +34,7 @@
#include "state.h"
#include "texcompress.h"
#include "framebuffer.h"
+#include "samplerobj.h"
/* This is a table driven implemetation of the glGet*v() functions.
* The basic idea is that most getters just look up an int somewhere
@@ -827,7 +828,16 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
{
struct gl_sampler_object *samp =
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler;
- v->value_int = samp ? samp->Name : 0;
+
+ /*
+ * The sampler object may have been deleted on another context,
+ * so we try to lookup the sampler object before returning its Name.
+ */
+ if (samp && _mesa_lookup_samplerobj(ctx, samp->Name)) {
+ v->value_int = samp->Name;
+ } else {
+ v->value_int = 0;
+ }
}
break;
/* GL_ARB_uniform_buffer_object */