summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_surface.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 8aad5f6c13..fb8c8d0826 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -61,6 +61,10 @@
#else
#define CLIP_TILE \
do { \
+ if (x >= ps->width) \
+ return; \
+ if (y >= ps->height) \
+ return; \
if (x + w > ps->width) \
w = ps->width - x; \
if (y + h > ps->height) \
@@ -907,13 +911,16 @@ put_tile_raw32(struct pipe_surface *ps,
unsigned i;
unsigned w0 = w;
+ assert(w < 1000);
assert(ps->region->map);
assert(ps->format == PIPE_FORMAT_S8_Z24 ||
ps->format == PIPE_FORMAT_U_Z32);
+ assert(w < 1000);
CLIP_TILE;
for (i = 0; i < h; i++) {
+ assert(w < 1000);
memcpy(dst, pSrc, w * sizeof(uint));
dst += ps->region->pitch;
pSrc += w0;
@@ -980,8 +987,6 @@ put_tile_raw16(struct pipe_surface *ps,
void
softpipe_init_surface_funcs(struct softpipe_surface *sps)
{
- sps->tc = sp_create_tile_cache();
-
assert(sps->surface.format);
switch (sps->surface.format) {