[Mesa-dev] [PATCH 3/6] si_pipe: do not dereference sscreen before checking if it is NULL.
Julien Isorce
julien.isorce at gmail.com
Thu Mar 16 14:25:25 UTC 2017
CID 1354483
Signed-off-by: Julien Isorce <jisorce at oblong.com>
---
src/gallium/drivers/radeonsi/si_pipe.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index a9a7c8f..6cbaa72 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -675,12 +675,12 @@ static void si_destroy_screen(struct pipe_screen* pscreen)
{
struct si_screen *sscreen = (struct si_screen *)pscreen;
struct si_shader_part *parts[] = {
- sscreen->vs_prologs,
- sscreen->vs_epilogs,
- sscreen->tcs_epilogs,
- sscreen->gs_prologs,
- sscreen->ps_prologs,
- sscreen->ps_epilogs
+ sscreen ? sscreen->vs_prologs : NULL,
+ sscreen ? sscreen->vs_epilogs : NULL,
+ sscreen ? sscreen->tcs_epilogs : NULL,
+ sscreen ? sscreen->gs_prologs : NULL,
+ sscreen ? sscreen->ps_prologs : NULL,
+ sscreen ? sscreen->ps_epilogs : NULL
};
unsigned i;
--
2.7.4
More information about the mesa-dev
mailing list