diff options
author | Francisco Jerez <[email protected]> | 2010-02-23 16:31:42 +0100 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2010-02-25 18:37:38 +0100 |
commit | 7432ffbdfa52b51b720bdde5cd50c497862b8806 (patch) | |
tree | 7e1d1071ca659fb3c5fb581e12a26f5f490bd349 /src/mesa/drivers | |
parent | 35041ec151fa6af71966d86869c38bc6b2f7606f (diff) |
dri/nouveau: Don't try to map a non-existent teximage.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_texture.c | 11 |
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; } |