[Mesa-dev] [PATCH] mesa: ignore VAO IDs equal to 0 in glDeleteVertexArrays

Marek Olšák maraeo at gmail.com
Thu Aug 30 19:16:59 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

This fixes a firefox crash.

Fixes: 781a78914c798dc64005b37c6ca1224ce06803fc
---
 src/mesa/main/arrayobj.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index a23031fe182..6e0665c0e5d 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -1007,20 +1007,24 @@ _mesa_BindVertexArray(GLuint id)
  *
  * \param n      Number of array objects to delete.
  * \param ids    Array of \c n array object IDs.
  */
 static void
 delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids)
 {
    GLsizei i;
 
    for (i = 0; i < n; i++) {
+      /* IDs equal to 0 should be silently ignored. */
+      if (!ids[i])
+         continue;
+
       struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
 
       if (obj) {
          assert(obj->Name == ids[i]);
 
          /* If the array object is currently bound, the spec says "the binding
           * for that object reverts to zero and the default vertex array
           * becomes current."
           */
          if (obj == ctx->Array.VAO)
-- 
2.17.1



More information about the mesa-dev mailing list