i965: Avoid null access in intelMakeCurrent()

separate two null checks connected with && to their own if branches.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
Juha-Pekka Heikkila
2014-04-25 15:20:36 +03:00
committed by Tapani Pälli
parent 36f8042e8c
commit 808b8e59c0
+7 -3
View File
@@ -985,13 +985,17 @@ intelMakeCurrent(__DRIcontext * driContextPriv,
struct gl_context *ctx = &brw->ctx;
struct gl_framebuffer *fb, *readFb;
if (driDrawPriv == NULL && driReadPriv == NULL) {
if (driDrawPriv == NULL) {
fb = _mesa_get_incomplete_framebuffer();
readFb = _mesa_get_incomplete_framebuffer();
} else {
fb = driDrawPriv->driverPrivate;
readFb = driReadPriv->driverPrivate;
driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1;
}
if (driReadPriv == NULL) {
readFb = _mesa_get_incomplete_framebuffer();
} else {
readFb = driReadPriv->driverPrivate;
driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
}