st/mesa: don't clobber glGetInternalformat* buffer for GL_NUM_SAMPLE_COUNTS
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 10 Oct 2017 11:58:46 +0000 (13:58 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 10 Oct 2017 11:58:46 +0000 (13:58 +0200)
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: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_format.c

index 5e38fe5689030b2aaf6af7b7d2154dca73fc321e..65be09cbde2b8208085920eef4c7e662abec4703 100644 (file)
@@ -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;
    }