Bug 86200 - cairo-matrix: invalid matrix created in _cairo_matrix_to_pixman_matrix_offset()
Summary: cairo-matrix: invalid matrix created in _cairo_matrix_to_pixman_matrix_offset()
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.12.16
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-12 14:16 UTC by André Draszik
Modified: 2018-08-25 13:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
test case (2.13 KB, text/plain)
2014-11-12 14:16 UTC, André Draszik
Details

Description André Draszik 2014-11-12 14:16:55 UTC
Created attachment 109340 [details]
test case

The attached test is a copy of the code in _cairo_matrix_to_pixman_matrix_offset()

Using the embedded values for the matrix, the cairo code converts this into a pixman_transform_t which can not be handled by pixman, due to 16 bit overflow.

I believe this particular matrix doesn't need any translation, as all values fit nicely into 16 bit from the start for pixman. The end-result is that the drawing operation fails, although it need not.


Not sure what the correct fix is, it could either check whether the matrix as passed in needs any modification for pixman, or it could check whether a smallest maximum norm was found before applying the matrix tranlation.
Comment 1 André Draszik 2014-11-12 14:20:39 UTC
output from running the program:

> matrix orig: xx/yx/xy/yy/x0/y0 38.835275 5.900283 310.889941 43.796450 266.442591 242.525857
> matrix new : xx/yx/xy/yy/x0/y0 38.835275 5.900283 310.889941 43.796450 85337.941552 12416.642356
> offset x/y: 267/-242

85337 > PIXMAN_MAX_INT (and _cairo_matrix_to_pixman_matrix() subsequently will return CAIRO_STATUS_INVALID_MATRIX), although all the input values are < PIXMAN_MAX_INT
Comment 2 GitLab Migration User 2018-08-25 13:47:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/199.


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.