glx: Check that swap_buffers_reply is non-NULL before using it
Check that the return value from xcb_dri2_swap_buffers_reply is non-NULL before accessing the struct members. Note: This is a candidate for the 9.0 branch. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -789,9 +789,11 @@ dri2XcbSwapBuffers(Display *dpy,
|
|||||||
|
|
||||||
swap_buffers_reply =
|
swap_buffers_reply =
|
||||||
xcb_dri2_swap_buffers_reply(c, swap_buffers_cookie, NULL);
|
xcb_dri2_swap_buffers_reply(c, swap_buffers_cookie, NULL);
|
||||||
ret = merge_counter(swap_buffers_reply->swap_hi,
|
if (swap_buffers_reply) {
|
||||||
swap_buffers_reply->swap_lo);
|
ret = merge_counter(swap_buffers_reply->swap_hi,
|
||||||
free(swap_buffers_reply);
|
swap_buffers_reply->swap_lo);
|
||||||
|
free(swap_buffers_reply);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user