intel/isl: Add an assert to check zero width/height surface
authorAnuj Phogat <anuj.phogat@gmail.com>
Tue, 20 Sep 2016 18:59:01 +0000 (11:59 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 4 Oct 2016 20:20:34 +0000 (13:20 -0700)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/isl/isl_surface_state.c

index 0dfeeaf..3bb0abd 100644 (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;