From b86b4b85e47f8ddef85da8a5d52ef798829d4087 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Jan 2025 07:50:44 -0500 Subject: [PATCH] mesa: use default params for clearbuffer functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this might otherwise pull in user-specified params from the unpack buffer and access arbitrary data cc: mesa-stable Reviewed-by: Marek Olšák (cherry picked from commit a5c3c452b812ed7b8225017d4ff420089ac404af) Part-of: --- .pick_status.json | 2 +- src/mesa/main/bufferobj.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ef51f7a12db..11a81d47eae 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1804,7 +1804,7 @@ "description": "mesa: use default params for clearbuffer functions", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 6ef81bcbd14..1ebbbff86da 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -995,10 +995,11 @@ convert_clear_buffer_data(struct gl_context *ctx, const GLvoid *data, const char *caller) { GLenum internalformatBase = _mesa_get_format_base_format(internalformat); + struct gl_pixelstore_attrib packing = {.Alignment = 1}; if (_mesa_texstore(ctx, 1, internalformatBase, internalformat, 0, &clearValue, 1, 1, 1, - format, type, data, &ctx->Unpack)) { + format, type, data, &packing)) { return true; } else {