glthread: handle DeleteBuffers(n=-1) gracefully
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 28 Sep 2022 01:42:49 +0000 (21:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 29 Sep 2022 22:05:06 +0000 (22:05 +0000)
this is a valid error condition

cc: mesa-stable

fixes:
GTF-GL46.gtf21.GL2FixedTests.buffer_objects.buffer_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18856>

src/mesa/main/glthread_bufferobj.c

index 615d3b3..df57404 100644 (file)
@@ -210,7 +210,7 @@ _mesa_glthread_DeleteBuffers(struct gl_context *ctx, GLsizei n,
 {
    struct glthread_state *glthread = &ctx->GLThread;
 
-   if (!buffers)
+   if (!buffers || n < 0)
       return;
 
    for (unsigned i = 0; i < n; i++) {