summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Noland <[email protected]>2009-10-14 13:58:56 -0500
committerAlex Deucher <[email protected]>2009-10-15 11:29:35 -0400
commite5d6450c2c85cc7d645cb0736194f41e5393802d (patch)
tree1359981509d3d721e6f8b6517df9416b269fff7a /src
parent22a0029a68cf6a17e5d799c7d8eb8a699ccdeabb (diff)
radeon: return EINVAL for 0 length buffers.
Signed-off-by: Robert Noland <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_bo_legacy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c
index 3e7547d2f9d..ce60a2f7eae 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;