See attached testcase. If you reduce the N_POINTS number, you can even output a somewhat correct test image.
Created attachment 7477 [details] [review] test patch
This fixed in the xorg xserver for a couple of release now, so marking closed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.