From 07c654e08fdf1e0fdaf55db9b18c055b15e8f0df Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 7 Oct 2022 00:42:08 -0400 Subject: [PATCH] glthread: fix buffer allocation size with non-signed buffer offset path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this needs to always add the start_offset to avoid creating buffers that are too small Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/glthread_bufferobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/glthread_bufferobj.c b/src/mesa/main/glthread_bufferobj.c index df57404022b..13908b90bc1 100644 --- a/src/mesa/main/glthread_bufferobj.c +++ b/src/mesa/main/glthread_bufferobj.c @@ -87,7 +87,7 @@ _mesa_glthread_upload(struct gl_context *ctx, const void *data, uint8_t *ptr; assert(*out_buffer == NULL); - *out_buffer = new_upload_buffer(ctx, size, &ptr); + *out_buffer = new_upload_buffer(ctx, size + start_offset, &ptr); if (!*out_buffer) return;