From: Francisco Jerez Date: Tue, 23 Feb 2010 15:31:42 +0000 (+0100) Subject: dri/nouveau: Don't try to map a non-existent teximage. X-Git-Tag: mesa-7.8~447 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7432ffbdfa52b51b720bdde5cd50c497862b8806;p=platform%2Fupstream%2Fmesa.git dri/nouveau: Don't try to map a non-existent teximage. --- diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 32603ab..5b788042 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; }