diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-18 10:59:59 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-18 15:25:40 -0700 |
commit | 227c395c00b69fc105546d479d751d92e923b4fc (patch) | |
tree | 4d37bdaffdaa4a6938662a9689744157dfe67204 /src/gallium/drivers/panfrost/pan_resource.c | |
parent | 79b13b437685b8dbe2e9938714eb4733b8b79a17 (diff) |
panfrost: Check for NULL surface in places
Fixes a bunch of NULL dereferences, although it does cause GPU faults of
course.
This is caused by color buffers masked out in MRT, which we'll
eventually have to solve the right way... one thing at a time.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_resource.c')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index d3cbfe70c77..3f8d50cad73 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -507,7 +507,10 @@ panfrost_transfer_map(struct pipe_context *pctx, bool is_bound = false; for (unsigned c = 0; c < fb->nr_cbufs; ++c) { - is_bound |= fb->cbufs[c]->texture == resource; + /* If cbufs is NULL, we're definitely not bound here */ + + if (fb->cbufs[c]) + is_bound |= fb->cbufs[c]->texture == resource; } if (is_bound && (usage & PIPE_TRANSFER_READ)) { |