Module: Mesa
Branch: master
Commit: 9a8f13a33b2d08b34c78de67ce90e0198bfdf0b3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a8f13a33b2d08b34c78de67ce90e0198bfdf0b3

Author: Nicolai Hähnle <[email protected]>
Date:   Tue Oct 10 13:58:46 2017 +0200

st/mesa: don't clobber glGetInternalformat* buffer for GL_NUM_SAMPLE_COUNTS

Applications might pass in a buffer that is sized too large and rely
on the extra space of the buffer not being overwritten.

Fixes 
dEQP-GLES31.functional.state_query.internal_format.partial_query.num_sample_counts

Cc: [email protected]
Reviewed-by: Marek Olšák <[email protected]>

---

 src/mesa/state_tracker/st_format.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index 5e38fe5689..65be09cbde 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -2378,9 +2378,10 @@ st_QueryInternalFormat(struct gl_context *ctx, GLenum 
target,
       break;
 
    case GL_NUM_SAMPLE_COUNTS: {
+      int samples[16];
       size_t num_samples;
       num_samples = st_QuerySamplesForFormat(ctx, target, internalFormat,
-                                             params);
+                                             samples);
       params[0] = (GLint) num_samples;
       break;
    }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to