summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/texgetimage.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 3c1e166ffa1..f62553dac24 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1213,6 +1213,13 @@ getteximage_error_check(struct gl_context *ctx,
"%s(format=GL_STENCIL_INDEX)", caller);
return true;
}
+ else if (_mesa_is_stencil_format(format)
+ && !_mesa_is_depthstencil_format(baseFormat)
+ && !_mesa_is_stencil_format(baseFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(format mismatch)", caller);
+ return true;
+ }
else if (_mesa_is_ycbcr_format(format)
&& !_mesa_is_ycbcr_format(baseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,