sna/dri2: Prevent NULL pointer dereference of Window private
In case we receive quick successive calls to DRI2GetBuffers on the same Window, we need to check that the private exists before dereferencing it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
fdd7508e53
commit
6f99bbe67e
|
|
@ -234,7 +234,11 @@ dri2_chain(DrawablePtr d)
|
|||
assert(priv != NULL);
|
||||
return priv->chain;
|
||||
}
|
||||
inline static DRI2BufferPtr dri2_window_get_front(WindowPtr win) { return dri2_window(win)->front; }
|
||||
inline static DRI2BufferPtr dri2_window_get_front(WindowPtr win)
|
||||
{
|
||||
struct dri2_window *priv = dri2_window(win);
|
||||
return priv ? priv->front : NULL;
|
||||
}
|
||||
#else
|
||||
inline static void *dri2_window_get_front(WindowPtr win) { return NULL; }
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue