summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_texture.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index 32603ab66d6..5b788042959 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -81,10 +81,12 @@ nouveau_teximage_map(GLcontext *ctx, struct gl_texture_image *ti)
struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface;
int ret;
- ret = nouveau_bo_map(s->bo, NOUVEAU_BO_RDWR);
- assert(!ret);
+ if (s->bo) {
+ ret = nouveau_bo_map(s->bo, NOUVEAU_BO_RDWR);
+ assert(!ret);
- ti->Data = s->bo->map;
+ ti->Data = s->bo->map;
+ }
}
static void
@@ -92,7 +94,8 @@ nouveau_teximage_unmap(GLcontext *ctx, struct gl_texture_image *ti)
{
struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface;
- nouveau_bo_unmap(s->bo);
+ if (s->bo)
+ nouveau_bo_unmap(s->bo);
ti->Data = NULL;
}