From e5d6450c2c85cc7d645cb0736194f41e5393802d Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 14 Oct 2009 13:58:56 -0500 Subject: radeon: return EINVAL for 0 length buffers. Signed-off-by: Robert Noland --- src/mesa/drivers/dri/radeon/radeon_bo_legacy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index 3e7547d2f9..ce60a2f7ea 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -710,6 +710,10 @@ int radeon_bo_legacy_validate(struct radeon_bo *bo, bo, bo->size, bo_legacy->map_count); return -EINVAL; } + if(bo->size == 0) { + fprintf(stderr, "bo(%p) has size 0.\n", bo); + return -EINVAL; + } if (bo_legacy->static_bo || bo_legacy->validated) { *soffset = bo_legacy->offset; *eoffset = bo_legacy->offset + bo->size; -- cgit v1.2.3