mesa: use default params for clearbuffer functions

this might otherwise pull in user-specified params
from the unpack buffer and access arbitrary data

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit a5c3c452b8)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
Mike Blumenkrantz
2025-01-08 07:50:44 -05:00
committed by Dylan Baker
parent db73e1121d
commit b86b4b85e4
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {