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: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 9a8f13a33b)
This commit is contained in:
Nicolai Hähnle 2017-10-10 13:58:46 +02:00 committed by Emil Velikov
parent 2eae2a6f0e
commit 4bcadb533f

View file

@ -2373,9 +2373,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;
}