st/mesa: Only call st_texture_image_unmap() if texImage->Data is non-NULL.
authorMichel Dänzer <daenzer@vmware.com>
Mon, 4 Jan 2010 15:54:29 +0000 (16:54 +0100)
committerMichel Dänzer <daenzer@vmware.com>
Mon, 4 Jan 2010 15:54:29 +0000 (16:54 +0100)
This was already done in st_TexImage() but was missed between incremental
changes to st_TexSubimage().

src/mesa/state_tracker/st_cb_texture.c

index d4630a514f8f2bf1bf4a00d2155c016a69712bfb..cb9106c7de886a6455d4ef740d297893249a61d1 100644 (file)
@@ -1090,7 +1090,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
 done:
    _mesa_unmap_teximage_pbo(ctx, packing);
 
-   if (stImage->pt) {
+   if (stImage->pt && texImage->Data) {
       st_texture_image_unmap(ctx->st, stImage);
       texImage->Data = NULL;
    }