From: Mike Blumenkrantz Date: Fri, 7 Oct 2022 04:42:08 +0000 (-0400) Subject: glthread: fix buffer allocation size with non-signed buffer offset path X-Git-Tag: upstream/22.3.5~1636 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07c654e08fdf1e0fdaf55db9b18c055b15e8f0df;p=platform%2Fupstream%2Fmesa.git 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 Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/mesa/main/glthread_bufferobj.c b/src/mesa/main/glthread_bufferobj.c index df57404..13908b9 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;