From: Robert Noland Date: Wed, 14 Oct 2009 18:58:56 +0000 (-0500) Subject: radeon: return EINVAL for 0 length buffers. X-Git-Tag: 062012170305~15905^2~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5d6450c2c85cc7d645cb0736194f41e5393802d;p=profile%2Fivi%2Fmesa.git radeon: return EINVAL for 0 length buffers. Signed-off-by: Robert Noland --- diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index 3e7547d..ce60a2f 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;