gallium: Ensure we don't add null objects to the table, as they mark empty handles.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 15 Mar 2008 00:55:28 +0000 (00:55 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 15 Mar 2008 01:35:18 +0000 (01:35 +0000)
src/gallium/auxiliary/util/u_handle_table.c

index ab427ee371da0f010f16ea38998379a023e2aa9d..d25872972aac2c200fd48a788f406f739e2c71d4 100644 (file)
@@ -175,6 +175,10 @@ handle_table_set(struct handle_table *ht,
    if(!handle || handle > ht->size)
       return 0;
 
+   assert(object);
+   if(!object)
+      return 0;
+   
    index = handle - 1;
 
    /* grow the table if necessary */