summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-04-25 15:20:36 +0300
committerTapani Pälli <[email protected]>2014-09-23 10:25:02 +0300
commit808b8e59c09ac5977ab020bd1771225a4e0a4cc4 (patch)
tree1f838df6f138475a71c9e46552671fa8b26f8127 /src
parent36f8042e8c4fc60533db299078cd25e13e1d0626 (diff)
i965: Avoid null access in intelMakeCurrent()
separate two null checks connected with && to their own if branches. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 5e2f175bdde..ca389f80d7b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -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;
}