intel/isl: Add an assert to check zero width/height surface

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Anuj Phogat 2016-09-20 11:59:01 -07:00
parent 0e85ff3355
commit 2c78b2ec90

View file

@ -258,6 +258,9 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
s.IntegerSurfaceFormat = isl_format_has_int_channel(s.SurfaceFormat);
#endif
assert(info->surf->logical_level0_px.width > 0 &&
info->surf->logical_level0_px.height > 0);
s.Width = info->surf->logical_level0_px.width - 1;
s.Height = info->surf->logical_level0_px.height - 1;