gallium/radeon: add an assertion to texture_transfer_map for app bugs
authorMarek Olšák <marek.olsak@amd.com>
Sun, 12 Feb 2017 14:48:31 +0000 (15:48 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 Feb 2017 20:47:51 +0000 (21:47 +0100)
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
src/gallium/drivers/radeon/r600_texture.c

index 5d84eb4a0860a0350a5e02af93483d3040e53ab0..47aa8b125313a696a92f11898211d8602c5b6c56 100644 (file)
@@ -1434,6 +1434,7 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
        bool use_staging_texture = false;
 
        assert(!(texture->flags & R600_RESOURCE_FLAG_TRANSFER));
+       assert(box->width && box->height && box->depth);
 
        /* Depth textures use staging unconditionally. */
        if (!rtex->is_depth) {