summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2020-04-07 09:42:39 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2020-04-21 09:16:18 +0200
commitdbfeec62c3852293d5f029db73ff7d63ff0f14e5 (patch)
treec240ba0e1d90f5a4557863c1fe70275894e0cf2c /src
parent7c43b8ce1b82f41e03147f824e87195ca8f1cb49 (diff)
mesa: fix crash in find_value
Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4584>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/get.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 7e9767d95e1..48f43cb55f3 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1619,8 +1619,12 @@ find_value(const char *func, GLenum pname, void **p, union value *v)
if (ctx->Texture.CurrentUnit < ARRAY_SIZE(ctx->Texture.FixedFuncUnit)) {
unsigned index = ctx->Texture.CurrentUnit;
*p = ((char *)&ctx->Texture.FixedFuncUnit[index] + d->offset);
+ return d;
}
- return d;
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(pname=%s,unit=%d)", func,
+ _mesa_enum_to_string(pname),
+ ctx->Texture.CurrentUnit);
+ return &error_value;
case LOC_CUSTOM:
find_custom_value(ctx, d, v);
*p = v;