From 4bcadb533ff07e87d045d8d4225784eab8729142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 10 Oct 2017 13:58:46 +0200 Subject: [PATCH] st/mesa: don't clobber glGetInternalformat* buffer for GL_NUM_SAMPLE_COUNTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 9a8f13a33b2d08b34c78de67ce90e0198bfdf0b3) --- 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 012f1a40151..c5dd0a5014d 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -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; }