The mask stride is calculated with: fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1); For the purposes of the stride only, this is equivalent to: maskStride = pMask->pixels->stride / sizeof(FbBits) * sizeof(FbBits) / sizeof(CARD8); But performing an integer-divide and then a multiply can lose data! For example, consider when pMask->pixels->stride == 2. Since sizeof(FbBits) == 4, the division yields zero, and maskStride ends up zero--which is clearly incorrect. I am including a test case. Compile test.c against cairo, and observe that although the mask used is a checkerboard pattern, the result is vertical lines. Because the mask stride is zero, each row ends up using the same mask. It is quite possible (likely?) that many places where fbGetDrawable is used have problems similar to this.
Created attachment 6133 [details] Test case
In order to use cairo/pixman you need to supply data that is aligned to uint32_t boundaries - applications can use cairo_format_stride_for_width() to compute the appropriate stride for their image data.
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.