The current state tracker can generate these sometimes. Fixing this is
more involved, and due to some integer math we can generate
divisions-by-zero.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
struct nouveau_pushbuf *push = nv50->base.pushbuf;
bool eng3d = FALSE;
+ if (info->src.box.width == 0 || info->src.box.height == 0 ||
+ info->dst.box.width == 0 || info->dst.box.height == 0) {
+ pipe_debug_message(&nv50->base.debug, ERROR,
+ "Blit with zero-size src or dst box");
+ return;
+ }
+
if (util_format_is_depth_or_stencil(info->dst.resource->format)) {
if (!(info->mask & PIPE_MASK_ZS))
return;
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
bool eng3d = false;
+ if (info->src.box.width == 0 || info->src.box.height == 0 ||
+ info->dst.box.width == 0 || info->dst.box.height == 0) {
+ pipe_debug_message(&nvc0->base.debug, ERROR,
+ "Blit with zero-size src or dst box");
+ return;
+ }
+
if (util_format_is_depth_or_stencil(info->dst.resource->format)) {
if (!(info->mask & PIPE_MASK_ZS))
return;