From 2f508f244e8e4cb4bb2b9f813548fbf0c89b77c1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 10 Sep 2013 14:46:23 +1000 Subject: [PATCH] st/mesa: don't dereference stObj->pt if NULL It seems a user app can get us into this state, I trigger the fail running fbo-maxsize inside virgl, it fails to create the backing storage for the texture object, but then segfaults here when it should fail the completeness test. Cc: "9.2" Reviewed-by: Brian Paul Signed-off-by: Dave Airlie --- src/mesa/state_tracker/st_cb_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 77aaccd0489..20894825f7f 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -502,7 +502,7 @@ st_validate_attachment(struct gl_context *ctx, if (att->Type != GL_TEXTURE) return GL_TRUE; - if (!stObj) + if (!stObj || !stObj->pt) return GL_FALSE; format = stObj->pt->format; -- 2.30.2