diff options
author | Lajos Molnar <molnar@ti.com> | 2011-04-07 08:41:44 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-04-07 08:41:44 +0100 |
commit | f9895d1b0a7912ba5080534aca79cb919246a2bb (patch) | |
tree | 4a5a1759c8922732a3c5f2f943bd7fc45a88d2b4 /drivers/media/video/tiler | |
parent | 7e7a3dea7e01e89884366006cb61890085f42816 (diff) |
TILER: Added checks for invalid (0) area allocation.
Allocating 0-sized area now fails.
Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
Diffstat (limited to 'drivers/media/video/tiler')
-rw-r--r-- | drivers/media/video/tiler/tiler-main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/tiler/tiler-main.c b/drivers/media/video/tiler/tiler-main.c index 603e347df43..1bd38aa2357 100644 --- a/drivers/media/video/tiler/tiler-main.c +++ b/drivers/media/video/tiler/tiler-main.c @@ -275,6 +275,10 @@ static s32 __analize_area(enum tiler_fmt fmt, u32 width, u32 height, u32 slot_row, min_align; const struct tiler_geom *g; + /* width and height must be positive */ + if (!width || !height) + return -1; + /* align must be 2 power */ if (*align & (*align - 1)) return -1; @@ -294,6 +298,7 @@ static s32 __analize_area(enum tiler_fmt fmt, u32 width, u32 height, return 0; } + /* format must be valid */ g = tiler.geom(fmt); if (!g) return -EINVAL; |