summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-09 22:55:15 +0100
committerBrian <brian.paul@tungstengraphics.com>2007-08-09 22:55:15 +0100
commitac36cdbcc1ce4d78df50150117b11861c6ea672b (patch)
treec6f6ade31d2f731fb7f45130cd4887117b5bc6f0 /src/mesa/pipe
parent78b1a29a0da8d1877408421df5012d37084a96de (diff)
added null ptr checks
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index ebc994670a..0794d9a888 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -84,12 +84,15 @@ static void map_surfaces(struct softpipe_context *sp)
GLuint i;
for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
- struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.cbufs[i]); pipe->region_map(pipe, sps->surface.region);
+ struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.cbufs[i]);
+ if (sps->surface.region)
+ pipe->region_map(pipe, sps->surface.region);
}
if (sp->framebuffer.zbuf) {
struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.zbuf);
- pipe->region_map(pipe, sps->surface.region);
+ if (sps->surface.region)
+ pipe->region_map(pipe, sps->surface.region);
}
/* textures */
@@ -111,12 +114,14 @@ static void unmap_surfaces(struct softpipe_context *sp)
for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.cbufs[i]);
- pipe->region_unmap(pipe, sps->surface.region);
+ if (sps->surface.region)
+ pipe->region_unmap(pipe, sps->surface.region);
}
if (sp->framebuffer.zbuf) {
struct softpipe_surface *sps = softpipe_surface(sp->framebuffer.zbuf);
- pipe->region_unmap(pipe, sps->surface.region);
+ if (sps->surface.region)
+ pipe->region_unmap(pipe, sps->surface.region);
}
/* textures */