glthread: fix buffer allocation size with non-signed buffer offset path
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 7 Oct 2022 04:42:08 +0000 (00:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Sat, 15 Oct 2022 16:02:38 +0000 (16:02 +0000)
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>

src/mesa/main/glthread_bufferobj.c

index df57404..13908b9 100644 (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;