summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-03-15 00:55:28 +0000
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-03-15 01:35:18 +0000
commitcb98f71d42e4c714dfb0c3e29d28d8418a1ee86b (patch)
tree22e98f8e0c04d46c7d5ed55ea321600840e4503a /src
parentc2bf23b8372607a5507a44ea3654c8af1083529a (diff)
gallium: Ensure we don't add null objects to the table, as they mark empty handles.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_handle_table.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_handle_table.c b/src/gallium/auxiliary/util/u_handle_table.c
index ab427ee371..d25872972a 100644
--- a/src/gallium/auxiliary/util/u_handle_table.c
+++ b/src/gallium/auxiliary/util/u_handle_table.c
@@ -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 */