diff options
author | Marek Olšák <[email protected]> | 2014-04-20 04:32:24 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-04-25 01:33:12 +0200 |
commit | e522c455e40b06a89885d413d564df40015259b3 (patch) | |
tree | 4fb74ff1af81b0c18a61203d6a26685ea30a912a /src/gallium/drivers/r300/r300_blit.c | |
parent | ba4f6a5fc93b80d23f8a355c219020e2022439f8 (diff) |
r300g: don't crash when getting NULL colorbuffers
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_blit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index cc9ea8a8e0d..05e55f3665e 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -130,7 +130,7 @@ static boolean r300_cbzb_clear_allowed(struct r300_context *r300, (struct pipe_framebuffer_state*)r300->fb_state.state; /* Only color clear allowed, and only one colorbuffer. */ - if ((clear_buffers & ~PIPE_CLEAR_COLOR) != 0 || fb->nr_cbufs != 1) + if ((clear_buffers & ~PIPE_CLEAR_COLOR) != 0 || fb->nr_cbufs != 1 || !fb->cbufs[0]) return FALSE; return r300_surface(fb->cbufs[0])->cbzb_allowed; @@ -313,7 +313,7 @@ static void r300_clear(struct pipe_context* pipe, /* Use fast color clear for an AA colorbuffer. * The CMASK is shared between all colorbuffers, so we use it * if there is only one colorbuffer bound. */ - if ((buffers & PIPE_CLEAR_COLOR) && fb->nr_cbufs == 1 && + if ((buffers & PIPE_CLEAR_COLOR) && fb->nr_cbufs == 1 && fb->cbufs[0] && r300_resource(fb->cbufs[0]->texture)->tex.cmask_dwords) { /* Try to obtain the access to the CMASK if we don't have one. */ if (!r300->cmask_access) { |