[Mesa-dev] [PATCH] st/mesa: don't dereference stObj->pt if NULL

Dave Airlie airlied at gmail.com
Fri Sep 13 19:15:58 PDT 2013


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.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/state_tracker/st_cb_fbo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 77aaccd..09daded 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -505,6 +505,9 @@ st_validate_attachment(struct gl_context *ctx,
    if (!stObj)
       return GL_FALSE;
 
+   if (!stObj->pt)
+      return GL_FALSE;
+
    format = stObj->pt->format;
    texFormat = att->Renderbuffer->TexImage->TexFormat;
 
-- 
1.8.1.4



More information about the mesa-dev mailing list