From: Eric Anholt Date: Fri, 16 Nov 2007 22:38:09 +0000 (-0800) Subject: [intel] Assert against 0-sized buffers in dri_bufmgr_fake.c. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4bc625e378dfc290af89ccc353e8b90ae734ccd0;p=mesa.git [intel] Assert against 0-sized buffers in dri_bufmgr_fake.c. They shouldn't be created, and this often helps catch stupid issues. --- diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c index a18abe10621..863484c8100 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;