Mesa (master): intel/isl: Add an assert to check zero width/height surface

Anuj Phogat aphogat at kemper.freedesktop.org
Tue Oct 4 20:28:03 UTC 2016


Module: Mesa
Branch: master
Commit: 2c78b2ec901ca87698b5f5fadb547e0fc727800d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c78b2ec901ca87698b5f5fadb547e0fc727800d

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Tue Sep 20 11:59:01 2016 -0700

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

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/isl/isl_surface_state.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 0dfeeaf..3bb0abd 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -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;
 




More information about the mesa-commit mailing list