diff options
author | Juha-Pekka Heikkila <[email protected]> | 2013-12-19 05:27:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-19 08:25:45 -0700 |
commit | cd6aaf2920ae69d743e5efe62bc26fa5ae678732 (patch) | |
tree | dc47c099a0f88e99cf4f200882fddb362b08ada3 /src/glx | |
parent | 149140e922a9fbf892c60a755788fb88d9757749 (diff) |
glx: Fix two identical null check errors in driSet/GetInterval
Signed-off-by: Juha-Pekka Heikkila <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri_glx.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 0b89e3e91c9..2e00bf0e0d8 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -747,13 +747,15 @@ static int driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval) { struct dri_drawable *pdp = (struct dri_drawable *) pdraw; - struct dri_screen *psc = (struct dri_screen *) pdraw->psc; - if (psc->swapControl != NULL && pdraw != NULL) { - psc->swapControl->setSwapInterval(pdp->driDrawable, interval); - return 0; - } + if (pdraw != NULL) { + struct dri_screen *psc = (struct dri_screen *) pdraw->psc; + if (psc->swapControl != NULL) { + psc->swapControl->setSwapInterval(pdp->driDrawable, interval); + return 0; + } + } return GLX_BAD_CONTEXT; } @@ -761,11 +763,13 @@ static int driGetSwapInterval(__GLXDRIdrawable *pdraw) { struct dri_drawable *pdp = (struct dri_drawable *) pdraw; - struct dri_screen *psc = (struct dri_screen *) pdraw->psc; - if (psc->swapControl != NULL && pdraw != NULL) - return psc->swapControl->getSwapInterval(pdp->driDrawable); + if (pdraw != NULL) { + struct dri_screen *psc = (struct dri_screen *) pdraw->psc; + if (psc->swapControl != NULL) + return psc->swapControl->getSwapInterval(pdp->driDrawable); + } return 0; } |