summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xfree86/dri2/dri2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 6459f11b1..f64ba7ca9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -156,6 +156,9 @@ GetScreenPrime(ScreenPtr master, int prime_id)
DRI2ScreenPtr ds;
ds = DRI2GetScreen(slave);
+ if (ds == NULL)
+ continue;
+
if (ds->prime_id == prime_id)
return slave;
}