nouveau: stop with 0 dimension
authorPatrice Mandin <patmandin@gmail.com>
Tue, 10 Feb 2009 21:04:56 +0000 (22:04 +0100)
committerPatrice Mandin <patmandin@gmail.com>
Tue, 10 Feb 2009 21:04:56 +0000 (22:04 +0100)
src/gallium/drivers/nv04/nv04_surface_2d.c

index d220c21..ffb17ea 100644 (file)
@@ -130,7 +130,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
        /* FIXME: Find right src and dst offset, given mipmap level */
        level_w = w;
        level_h = h;
-       for (i=0; i<src->level; i++) {
+       for (i=0; i<src->level && level_w && level_h; i++) {
                dst_offset += level_w * level_h * dst->block.size;
                level_w >>= 1;
                level_h >>= 1;