diff --git a/src/gallium/drivers/asahi/agx_streamout.c b/src/gallium/drivers/asahi/agx_streamout.c index 85452b62f62..59b270830c6 100644 --- a/src/gallium/drivers/asahi/agx_streamout.c +++ b/src/gallium/drivers/asahi/agx_streamout.c @@ -67,7 +67,7 @@ agx_set_stream_output_targets(struct pipe_context *pctx, unsigned num_targets, * Gallium contract and it will work out fine. Probably should be * redefined to be ~0 instead of -1 but it doesn't really matter. */ - if (offsets[i] != -1) { + if (offsets[i] != -1 && targets[i] != NULL) { pipe_buffer_write(pctx, agx_so_target(targets[i])->offset, 0, 4, &offsets[i]); }