Mesa (9.2): st/mesa: don't dereference stObj->pt if NULL

Carl Worth cworth at kemper.freedesktop.org
Fri Sep 27 23:03:18 UTC 2013


Module: Mesa
Branch: 9.2
Commit: 3801e9a87ed350e9891771967295048e3eab209e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3801e9a87ed350e9891771967295048e3eab209e

Author: Dave Airlie <airlied at gmail.com>
Date:   Tue Sep 10 14:46:23 2013 +1000

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" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp at vmware.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit 2f508f244e8e4cb4bb2b9f813548fbf0c89b77c1)

---

 src/mesa/state_tracker/st_cb_fbo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 77aaccd..2089482 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;




More information about the mesa-commit mailing list