summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-11-16 14:38:09 -0800
committerEric Anholt <eric@anholt.net>2007-11-16 15:36:18 -0800
commit4bc625e378dfc290af89ccc353e8b90ae734ccd0 (patch)
tree22f03764a6883eb6e5f396021ef69605db0bad7a /src/mesa/drivers
parent00eb5635c6e0a41524c55f450a6a9ce8ba5d6be8 (diff)
[intel] Assert against 0-sized buffers in dri_bufmgr_fake.c.
They shouldn't be created, and this often helps catch stupid issues.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index a18abe1062..863484c810 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -554,6 +554,8 @@ dri_fake_bo_alloc(dri_bufmgr *bufmgr, const char *name,
bufmgr_fake = (dri_bufmgr_fake *)bufmgr;
+ assert(size != 0);
+
bo_fake = calloc(1, sizeof(*bo_fake));
if (!bo_fake)
return NULL;
@@ -590,6 +592,8 @@ dri_fake_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
bufmgr_fake = (dri_bufmgr_fake *)bufmgr;
+ assert(size != 0);
+
bo_fake = calloc(1, sizeof(*bo_fake));
if (!bo_fake)
return NULL;