mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
glx: Fix two identical null check errors in driSet/GetInterval
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
149140e922
commit
cd6aaf2920
1 changed files with 12 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue