summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-08 19:19:52 -0600
committerBrian Paul <[email protected]>2008-05-08 19:19:52 -0600
commit2a39dbe7364af5444b1eb43650dfc31ed09257dc (patch)
tree3ea7a9799e35a4b4d3a1ab036e4e483038169f87 /src/mesa/state_tracker/st_texture.c
parent044d583ba12689cbe99098eb999854303de57f59 (diff)
gallium: fix out of tex memory crashes
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index d0f56c9717c..9553b34e317 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -197,7 +197,10 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
stImage->level, zoffset,
flags);
- return screen->surface_map(screen, stImage->surface, flags);
+ if (stImage->surface)
+ return screen->surface_map(screen, stImage->surface, flags);
+ else
+ return NULL;
}