panfrost: Fix NULL deref in pan_sfbd

The last of the nr_cbufs audit changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>
This commit is contained in:
Alyssa Rosenzweig 2021-02-19 09:58:33 -05:00 committed by Marge Bot
parent a124c47b9f
commit 76fb3961b1

View file

@ -221,7 +221,7 @@ panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws)
/* SFBD does not support MRT natively; sanity check */
assert(batch->key.nr_cbufs <= 1);
if (batch->key.nr_cbufs) {
if (batch->key.nr_cbufs && batch->key.cbufs[0]) {
struct pipe_surface *surf = batch->key.cbufs[0];
struct panfrost_resource *rsrc = pan_resource(surf->texture);
struct panfrost_bo *bo = rsrc->bo;