[Mesa-dev] [PATCH] st/mesa: check ureg_create() retval in create_pbo_upload_vs()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Tue Feb 9 10:40:08 UTC 2016
This avoids a possible NULL dereference because ureg_create() might
return a NULL pointer.
Spotted by coverity.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Cc: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/mesa/state_tracker/st_cb_texture.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index e9ac9a6..bdd2f63 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1132,6 +1132,8 @@ create_pbo_upload_vs(struct st_context *st)
struct ureg_dst out_layer;
ureg = ureg_create(TGSI_PROCESSOR_VERTEX);
+ if (!ureg)
+ return NULL;
in_pos = ureg_DECL_vs_input(ureg, TGSI_SEMANTIC_POSITION);
--
2.7.1
More information about the mesa-dev
mailing list