From: Dave Airlie Date: Tue, 10 Sep 2013 04:46:23 +0000 (+1000) Subject: st/mesa: don't dereference stObj->pt if NULL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f508f244e8e4cb4bb2b9f813548fbf0c89b77c1;p=mesa.git 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 --- 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;