glthread: fix buffer allocation size with non-signed buffer offset path

this needs to always add the start_offset to avoid creating
buffers that are too small

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18994>
This commit is contained in:
Mike Blumenkrantz
2022-10-07 00:42:08 -04:00
committed by Marge Bot
parent 9fc4cb8067
commit 07c654e08f

View File

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