summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/cell
diff options
context:
space:
mode:
authorJonathan White <[email protected]>2008-10-30 15:53:12 -0600
committerJonathan White <[email protected]>2008-10-30 15:53:39 -0600
commit443e102fdc8084dd2c73549c83de10524eb94b31 (patch)
tree5412e219349cd3dd2f1015cd434b648360f0a647 /src/gallium/drivers/cell
parent711f8a1dd94e2e1e715615d947e03015ef972326 (diff)
cell: Protected use of non-initialized untile buffers
Diffstat (limited to 'src/gallium/drivers/cell')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index 7734381c7ee..28161d166e4 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -376,8 +376,10 @@ cell_untwiddle_texture(struct pipe_screen *screen,
}
break;
default:
- printf("Cell: untwiddle unsupported texture format\n");
- ;
+ {
+ ct->untiled_data[level] = NULL;
+ printf("Cell: untwiddle unsupported texture format\n");
+ }
}
pipe_buffer_unmap(screen, surface->buffer);
@@ -442,7 +444,8 @@ cell_tex_surface_release(struct pipe_screen *screen,
struct cell_texture *ct = cell_texture((*s)->texture);
const uint level = (*s)->level;
- if ((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) {
+ if (((*s)->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level]))
+ {
align_free(ct->untiled_data[level]);
ct->untiled_data[level] = NULL;
}
@@ -476,7 +479,7 @@ cell_surface_map(struct pipe_screen *screen,
return NULL;
else
{
- if (surface->usage & PIPE_BUFFER_USAGE_CPU_READ) {
+ if ((surface->usage & PIPE_BUFFER_USAGE_CPU_READ) && (ct->untiled_data[level])) {
return (void *) ((ubyte *) ct->untiled_data[level] + surface->offset);
}
else {